import { Meta, StoryObj } from '@storybook/react-vite'
import { Switch } from './switch'
import { Label } from '@components/ui/label/label'

const meta: Meta<typeof Switch> = {
  title: 'Switch',
  component: Switch,
  tags: ['autodocs'],
  parameters: {
    layout: 'centered',
  },
  argTypes: {
    disabled: {
      control: 'boolean',
    },
  },
}

export default meta

export const Default: StoryObj<typeof meta> = {
  args: {
    disabled: false,
  },
  render: (args) => (
    <div className="flex items-center justify-center">
      <div className="flex items-center space-x-2">
        <Switch id="airplane-mode" disabled={args.disabled} />
        <Label htmlFor="airplane-mode">Airplane Mode</Label>
      </div>
    </div>
  ),
}
