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,
  children = undefined,
} = {}) => ({
  isChecked: boolean('isChecked', isChecked),
  isHidden: boolean('isHidden', isHidden),
  label: text('label', label),
  onChange: button('onChange', action('clicked', onChange)),
  children: text('children', children),
});

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