import React from 'react';
import { storiesOf } from '@storybook/react';
import ReceiveOfferForm from './index';

const handleClick = () => {
    // eslint-disable-next-line no-console
    console.log(componentRef.current.validate());
};

const componentRef = React.createRef();

storiesOf('ReceiveOfferForm', module)
    .add('with approval', () => (
        <React.Fragment>
            <button onClick={handleClick}>validate</button>
            <ReceiveOfferForm displayApproval={true} innerRef={componentRef} />
        </React.Fragment>
    ))
    .add('without approval', () => (
        <React.Fragment>
            <button onClick={handleClick}>validate</button>
            <ReceiveOfferForm displayApproval={false} innerRef={componentRef} />
        </React.Fragment>
    ));
