import React, { useState } from 'react'
import { type Meta, type StoryObj } from '@storybook/react'
import { Button } from '~components/ButtonV1'
import { Text } from '~components/Text'
import { Tab, TabList, TabPanel, Tabs, type Key } from '../index'
const meta = {
title: 'Components/Tabs',
component: Tabs,
args: {
children: (
<>
Tab 1
Tab 2
Tab 3
Disabled Tab
Tab 4
Tab 5
Content 1
Content 2
Content 3
Content 4
Content 4
Content 5
>
),
},
} satisfies Meta
export default meta
type Story = StoryObj
export const Playground: Story = {
parameters: {
chromatic: { disable: false },
docs: {
canvas: {
sourceState: 'shown',
},
},
},
args: {
defaultSelectedKey: 'one',
onSelectionChange: (key): void => console.log('Tab changed to ', key),
},
}
export const Controlled: Story = {
render: () => {
const [selectedKey, setSelectedKey] = useState(0)
return (
<>
Tab 1
Tab 2
Content 1
Content 2