import React from 'react'
import { boolean, number, withKnobs } from '@storybook/addon-knobs'
import { Button } from '../Button'
import { Modal } from '.'

export const modal = () => (
  <Modal
    element="body"
    isOpen={boolean('isOpen', false)}
    closeTimeoutMS={number('closeTimeoutMS', 300)}
    // eslint-disable-next-line no-console
    // @ts-ignore
    onRequestClose={() => console.log('onRequestClose()')}
  >
    <Button>Stuff</Button>
  </Modal>
)

export default {
  component: Modal,
  title: 'Modal',
  decorators: [withKnobs],
}
