Files
VirtWeb/virtweb_frontend/src/widgets/forms/CheckboxInput.tsx
Pierre HUBERT b28ca5f27d
Some checks failed
continuous-integration/drone/push Build is failing
Add new options
2025-06-16 19:42:57 +02:00

29 lines
640 B
TypeScript

import { Checkbox, FormControlLabel } from "@mui/material";
export function CheckboxInput(p: {
editable: boolean;
label: string;
checked: boolean | undefined;
onValueChange: (v: boolean) => void;
}): React.ReactElement {
//if (!p.editable && p.checked)
// return <Typography variant="body2">{p.label}</Typography>;
//if (!p.editable) return <></>;
return (
<FormControlLabel
control={
<Checkbox
disabled={!p.editable}
checked={p.checked}
onChange={(e) => {
p.onValueChange(e.target.checked);
}}
/>
}
label={p.label}
/>
);
}