import type { Meta, StoryObj } from '@storybook/nextjs' import { useState } from 'react' import TabHeader from '.' import type { ITabHeaderProps } from '.' const items: ITabHeaderProps['items'] = [ { id: 'overview', name: 'Overview' }, { id: 'playground', name: 'Playground' }, { id: 'changelog', name: 'Changelog', extra: New }, { id: 'docs', name: 'Docs', isRight: true }, { id: 'settings', name: 'Settings', isRight: true, disabled: true }, ] const TabHeaderDemo = ({ initialTab = 'overview', }: { initialTab?: string }) => { const [activeTab, setActiveTab] = useState(initialTab) return (
Tabs active="{activeTab}"
) } const meta = { title: 'Base/Navigation/TabHeader', component: TabHeaderDemo, parameters: { layout: 'centered', docs: { description: { component: 'Two-sided header tabs with optional right-aligned actions. Disabled items illustrate read-only states.', }, }, }, argTypes: { initialTab: { control: 'radio', options: items.map(item => item.id), }, }, args: { initialTab: 'overview', }, tags: ['autodocs'], } satisfies Meta export default meta type Story = StoryObj export const Playground: Story = {}