
/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { reduxForm, Field } from 'redux-form';
import { text, object, boolean } from '@storybook/addon-knobs';
import { required } from 'store/utils/validation';
import Wysiwyg from './Wysiwyg';


storiesOf('admin/formItems/Wysiwyg', module)
  .addDecorator(story => {
    
    const Wrapper = reduxForm({ form: 'test' })(() => story());
    return <Wrapper />;
  })
  .add('default', () => <Field name="test" component={Wysiwyg} label="Wysiwyg" />)
  .add('custom', () => (
    <Field
      name="test"
      component={Wysiwyg}
      label={text('label', 'Wysiwyg')}
      withBorder={boolean('withBorder', false)}
      withValueBorder={boolean('withValueBorder', false)}
      labelIcon={text('labelIcon', '')}
      // styling
      fieldWrapperStyle={object('fieldWrapperStyle', {})}
      labelStyle={object('labelStyle', {})}
      labelIconStyle={object('labelIconStyle', {})}
      valueStyle={object('valueStyle', {})}
      validate={required}
    />
  ));
