import React from 'react'; import { kebabCase, startCase } from 'lodash'; import PropTypes from 'prop-types'; import { Alert, Col, ControlLabel, FormControl, FormGroup, HelpBlock } from '@freecodecamp/react-bootstrap'; import { Field } from 'react-final-form'; const propTypes = { fields: PropTypes.arrayOf(PropTypes.string.isRequired).isRequired, options: PropTypes.shape({ ignored: PropTypes.arrayOf(PropTypes.string), placeholder: PropTypes.bool, required: PropTypes.arrayOf(PropTypes.string), types: PropTypes.objectOf(PropTypes.string) }) }; function FormFields(props) { const { fields, options = {} } = props; const { ignored = [], placeholder = true, required = [], types = {} } = options; return (