import { action } from '@storybook/addon-actions';
import { Meta, moduleMetadata, Story } from '@storybook/angular';
import { TextComponent } from '../../text/text.component';
import { TabButtonComponent } from './tab-button.component';

export default {
    title: 'Components/TabButton',
    component: TabButtonComponent,
    decorators: [
        moduleMetadata({
            declarations: [TextComponent],
        }),
    ],
    argTypes: {
        label: {
            control: 'text',
        },
        value: {
            control: 'object',
        },
        active: {
            control: 'boolean',
        },
        disabled: {
            control: 'boolean',
        },
    },
} as Meta;

const onClick = action('onClick');

const Template: Story<TabButtonComponent> = (args) => {
    return {
        props: {
            ...args,
            onClick,
        },
    };
};

export const Default = Template.bind({});
Default.args = {
    label: '10 апреля',
    value: {
        date: '10 апреля',
    },
    active: false,
    disabled: false,
};
