({ label, input, labelWidth = 50, labelPadding, height, className })
| 10 | import styles from 'components/Field/Field.scss'; |
| 11 | |
| 12 | const Field = ({ label, input, labelWidth = 50, labelPadding, height, className }) => { |
| 13 | const classes = [styles.field]; |
| 14 | if (className) { |
| 15 | classes.push(className); |
| 16 | } |
| 17 | labelWidth = labelWidth || 50; |
| 18 | if (label && labelPadding) { |
| 19 | label = React.cloneElement(label, { |
| 20 | ...label.props, |
| 21 | padding: labelPadding, |
| 22 | }); |
| 23 | } |
| 24 | return ( |
| 25 | <div |
| 26 | className={classes.join(' ')} |
| 27 | style={{ '--modal-label-ratio': labelWidth / 100 }} |
| 28 | > |
| 29 | <div |
| 30 | className={styles.left} |
| 31 | style={{ |
| 32 | height: height, |
| 33 | }} |
| 34 | > |
| 35 | {label} |
| 36 | </div> |
| 37 | <div className={styles.right} style={{ height: height }}> |
| 38 | {input} |
| 39 | </div> |
| 40 | </div> |
| 41 | ); |
| 42 | }; |
| 43 | |
| 44 | export default Field; |
| 45 |
nothing calls this directly
no outgoing calls
no test coverage detected