(props)
| 18 | }; |
| 19 | |
| 20 | function FormGroup(props) { |
| 21 | const { |
| 22 | className, |
| 23 | cssModule, |
| 24 | row, |
| 25 | disabled, |
| 26 | check, |
| 27 | inline, |
| 28 | floating, |
| 29 | noMargin, |
| 30 | tag: Tag = 'div', |
| 31 | switch: switchProp, |
| 32 | ...attributes |
| 33 | } = props; |
| 34 | |
| 35 | const formCheck = check || switchProp; |
| 36 | |
| 37 | const classes = mapToCssModules( |
| 38 | classNames( |
| 39 | className, |
| 40 | row ? 'row' : false, |
| 41 | formCheck ? 'form-check' : false, |
| 42 | switchProp ? 'form-switch' : false, |
| 43 | formCheck || noMargin ? false : 'mb-3', |
| 44 | formCheck && inline ? 'form-check-inline' : false, |
| 45 | formCheck && disabled ? 'disabled' : false, |
| 46 | floating && 'form-floating', |
| 47 | ), |
| 48 | cssModule, |
| 49 | ); |
| 50 | |
| 51 | if (Tag === 'fieldset') { |
| 52 | attributes.disabled = disabled; |
| 53 | } |
| 54 | |
| 55 | return <Tag {...attributes} className={classes} />; |
| 56 | } |
| 57 | |
| 58 | FormGroup.propTypes = propTypes; |
| 59 |
nothing calls this directly
no test coverage detected
searching dependent graphs…