import { Col, FormFeedback, FormGroup, FormText, Input, InputGroup, Label, } from '//components/Bootstrap'; export const FormBlock = ({ children, grouped = false, helpText = null, invalidText = null, label, type = 'text', validText = null, ...props }) => { let formElement = (children !== undefined) ? children : ; if (grouped !== false) { formElement = {formElement} } const helperText = (helpText !== null) ? {helpText} : null; let feedbackText = invalidText if (feedbackText === null && props.required === true) { feedbackText = 'This field is required.'; } const feedback = (feedbackText !== null) ? {feedbackText} : null; return ( {formElement} {helperText} {feedback} ); };