import { useState } from 'react' import type { Meta, StoryObj } from '@storybook/react-vite' import { Switch } from './Switch' const meta: Meta = { title: 'UI/Switch', component: Switch, tags: ['autodocs'], argTypes: { label: { control: 'text' }, description: { control: 'text' }, checked: { control: 'boolean' }, disabled: { control: 'boolean' }, }, parameters: { design: { type: 'figma', url: 'https://www.figma.com/design/mrabO6AtxN3ektGiTk0I9c/ResearchInsights?node-id=33-5337', }, }, } export default meta type Story = StoryObj const ControlledSwitch = (props: React.ComponentProps) => { const [checked, setChecked] = useState(props.checked ?? false) return } export const Default: Story = { render: () => , } export const On: Story = { render: () => , } export const WithDescription: Story = { render: () => ( ), } export const Disabled: Story = { render: () => (
), } export const Standalone: Story = { render: () => (
Dark mode
), } export const AllStates: Story = { render: () => (
), }