({ value, label, onChange, disabled = false })
| 3 | import { FormControlLabel, Checkbox } from '@mui/material' |
| 4 | |
| 5 | export const CheckboxInput = ({ value, label, onChange, disabled = false }) => { |
| 6 | const [myValue, setMyValue] = useState(value) |
| 7 | |
| 8 | return ( |
| 9 | <> |
| 10 | <FormControlLabel |
| 11 | sx={{ mt: 1, width: '100%' }} |
| 12 | size='small' |
| 13 | control={ |
| 14 | <Checkbox |
| 15 | disabled={disabled} |
| 16 | checked={myValue} |
| 17 | onChange={(event) => { |
| 18 | setMyValue(event.target.checked) |
| 19 | onChange(event.target.checked) |
| 20 | }} |
| 21 | /> |
| 22 | } |
| 23 | label={label} |
| 24 | /> |
| 25 | </> |
| 26 | ) |
| 27 | } |
| 28 | |
| 29 | CheckboxInput.propTypes = { |
| 30 | value: PropTypes.bool, |
nothing calls this directly
no test coverage detected