import type {Meta, StoryObj} from "@storybook/react";
import BlockedInput from "../../components/UI/BlockedInput/BlockedInput";
import {useArgs} from "@storybook/preview-api";


const meta: Meta<typeof BlockedInput> = {
    title:'Components/BlockedInput/BlockedInput',
    component: BlockedInput,
};

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

export const BlockedInputEx: Story = {
    render: (args) => {

        const [{value}, updateArgs] = useArgs();

        function handleChange(v: number | string) {
            updateArgs({value: v});
        }

        return <BlockedInput {...args} onChange={handleChange}  />;
    },

    args: {
        size: 6,
        hasError: false,
        value: '1234',
        onChange: () => 'henlo'
    },
    argTypes: {

    }
};


