import type { Meta, StoryObj } from '@storybook/svelte';
import Toggle from './Toggle.svelte';

const meta = {
  title: 'UI/Toggle',
  component: Toggle,
  tags: ['autodocs'],
  parameters: {
    docs: {
      description: {
        component: 'Ein/Aus-Schalter mit optionalem Label. `checked` und `disabled` steuerbar.',
      },
    },
  },
  argTypes: {
    checked: { control: 'boolean' },
  },
} satisfies Meta<Toggle>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Off: Story = {
  args: {
    label: 'Aus',
    checked: false,
  },
};

export const On: Story = {
  args: {
    label: 'An',
    checked: true,
  },
};

export const NoLabel: Story = {
  args: {
    checked: false,
  },
};

export const Disabled: Story = {
  args: {
    label: 'Deaktiviert',
    checked: false,
    disabled: true,
  },
};
