import React from 'react' import { type Meta, type StoryObj } from '@storybook/react-vite' import { NavLink, useLocation } from 'react-router-dom' import { DocsTemplate } from '../../../../.storybook' import RouterTabs from './RouterTabs' const meta: Meta = { title: 'Components/Tabs/RouterTabs', component: RouterTabs, parameters: { design: { type: 'figma', url: 'https://www.figma.com/design/RvhKD82948FMQnh5MyCi0o/Web-Design-System?node-id=121-348&t=CdMnrLNv0lNFwXr0-0', }, docs: { page: () => ( The RouterTabs component is very similar to{' '} Tabs. It is a user interface element used to organize content into distinct sections, but it also updates the page url when a new tab is clicked. Each tab represents a different section, and when a tab is active, only the content associated with that tab is visible, while the content of other tabs remains hidden. RouterTabs provide an intuitive and space-efficient way to navigate between different sections of a page. } infoBullets={[ Use the RouterTabs component to organize content into distinct sections. , The active tab will appear with unique styles, making it clear which section is currently being viewed. , ]} /> ), }, }, } export default meta type Story = StoryObj const CurrentPathName = () => { const { pathname } = useLocation() return pathname } const Template: Story = { render: (args) => { return ( First Second Third ) }, } const mobileConfig = { mobileConfig: [ { label: 'Link 1', link: '/link1-path', }, { label: 'Link 2', link: '/link2-path', subrows: [ { label: 'Sub Link 1', link: '/sublink1-path', }, { label: 'Sub Link 2', link: '/sublink2-path', }, ], }, ], } export const Basic: Story = { ...Template, args: { ...mobileConfig, }, } export const SubTabs: Story = { ...Template, args: { subtabs: true, ...mobileConfig, }, }