import type { Meta, StoryObj } from '@storybook/react';
import { Textarea } from './textarea';

const meta = {
    title: 'UI/Textarea',
    component: Textarea,
    tags: ['autodocs'],
    argTypes: {
        label: { control: 'text' },
        placeholder: { control: 'text' },
        error: { control: 'text' },
        disabled: { control: 'boolean' },
    },
    args: {
        placeholder: 'Type your message here.',
    }
} satisfies Meta<typeof Textarea>;

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

export const Default: Story = {};

export const WithLabel: Story = {
    args: {
        label: 'Bio',
        placeholder: 'Tell us a little bit about yourself',
    },
};

export const WithError: Story = {
    args: {
        label: 'Description',
        value: 'Too short',
        error: 'Description must be at least 10 characters.',
    },
};

export const Disabled: Story = {
    args: {
        label: 'Disabled',
        placeholder: 'Cannot type here',
        disabled: true,
    },
};
