Files
Shortumation/webapp/src/components/Inputs/InputBoolean.tsx
T
2022-05-24 21:12:01 -04:00

21 lines
557 B
TypeScript

import Checkbox from "@mui/material/Checkbox";
import FormGroup from '@mui/material/FormGroup';
import FormControlLabel from '@mui/material/FormControlLabel';
export interface Props {
label: string;
value: boolean;
onChange: (v: boolean) => void;
disabled?: boolean;
}
export default function InputBoolean({
label,
value = false,
onChange,
disabled = false,
}: Props) {
return <FormGroup>
<FormControlLabel disabled={disabled} control={<Checkbox checked={value} onChange={() => onChange(!value)} />} label={label} />
</FormGroup>
}