import { Story, Meta } from '@storybook/react';
import { Checkbox } from '../checkbox';
import type { CheckboxProps } from '../checkbox';

export default {
  component: Checkbox,
  title: 'Forms/Checkbox',
  argTypes: {
    checked: {
      description: 'The active state of the checkbox'
    },
    disabled: {
      description: 'The disabled state of the checkbox'
    },
    error: {
      description: 'An error state flag for the checkbox component'
    },
    indeterminate: {
      description: 'An indeterminate (Partly) state for the checkbox component'
    },
    formControlLabelProps: {
      description: 'Props which will be supplied directly into the form control label component.'
    }
  }
} as Meta;

const Template: Story<CheckboxProps> = args => {
  return <Checkbox {...args} />;
};

export const Primary = Template.bind({});
Primary.args = {
  checked: false,
  disabled: false,
  error: false,
  indeterminate: false
};

export const Unchecked = Template.bind({});
Unchecked.args = {
  checked: false,
  disabled: false,
  error: false,
  formControlLabelProps: {
    label: 'Default'
  },
  indeterminate: false
};
