/* eslint-disable import/no-extraneous-dependencies */
import React from 'react';
import { storiesOf } from '@storybook/react';
import { reduxForm } from 'redux-form';
import GenericFieldArray from './GenericFieldArray';

storiesOf('admin/formHelpers/GenericFieldArray', module)
  .addDecorator(story => {
    const Wrapper = reduxForm({ form: 'test' })(() => story());
    return <Wrapper />;
  })
  .add('GenericFieldArray component', () => {
    const info = {
      id: { type: 'string', label: 'id' },
      master: { type: 'multi', label: 'master' },
      tester: { type: 'multi', label: 'tester' },
    };
    return <GenericFieldArray label="test" labelAdd="Add" infos={info} fields={[info]} />;
  });
