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

const meta = {
  title: 'UI/Select',
  component: Select,
  tags: ['autodocs'],
  parameters: {
    docs: {
      description: {
        component: 'Dropdown-Auswahl. `options`: Array aus `{ value, label }`. `bind:value` für die gewählte value.',
      },
    },
  },
} satisfies Meta<Select>;

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

const options = [
  { value: 'a', label: 'Option A' },
  { value: 'b', label: 'Option B' },
  { value: 'c', label: 'Option C' },
];

export const Default: Story = {
  args: {
    label: 'Auswahl',
    placeholder: 'Bitte wählen',
    options,
    value: '',
  },
};

export const WithValue: Story = {
  args: {
    label: 'Auswahl',
    options,
    value: 'b',
  },
};
