import React, { Fragment } from 'react';
import { FieldArray } from 'redux-form';
import { withStyles } from '@material-ui/core/styles';
import renderDiagnoses from './renderDiagnoses';
import FormTitle from '../../../Titles/FormTitle';

const DiagnosesSection = ({
  classes, recorder, patient, encounter,
}) => (
  <Fragment>
    <FormTitle
      title={'What\'s the diagnosis'}
    />
    <FieldArray
      name="diagnosis"
      props={{
        classes, recorder, patient, encounter
      }}
      component={renderDiagnoses}
    />
  </Fragment>
);

DiagnosesSection.defaultProps = {
  encounter: ''
};
export default DiagnosesSection;
