import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { text, button, boolean } from '@storybook/addon-knobs';
import Checkbox from './component';

const props = ({
  isChecked = undefined,
  isHidden = undefined,
  label = undefined,
  onChange = undefined,
} = {}) => ({
  isChecked: boolean('isChecked', isChecked),
  isHidden: boolean('isHidden', isHidden),
  label: text('label', label),
  onChange: button('onChange', action('clicked', onChange)),
});

storiesOf('Web/form/Switch', module)
  .add('default', () => (
    <Checkbox {...props()} />
  ))
