Can create accommodation from WebUI

This commit is contained in:
2024-06-10 22:00:30 +02:00
parent f83cbe1386
commit 7d64ea219f
8 changed files with 296 additions and 5 deletions

View File

@@ -5,16 +5,20 @@ export function PropCheckbox(p: {
label: string;
checked: boolean | undefined;
onValueChange: (v: boolean) => void;
checkboxAlwaysVisible?: boolean;
}): React.ReactElement {
if (!p.editable && p.checked)
return <Typography variant="body2">{p.label}</Typography>;
if (!p.checkboxAlwaysVisible) {
if (!p.editable && p.checked)
return <Typography variant="body2">{p.label}</Typography>;
if (!p.editable) return <></>;
if (!p.editable) return <></>;
}
return (
<FormControlLabel
control={
<Checkbox
disabled={!p.editable}
checked={p.checked}
onChange={(e) => p.onValueChange(e.target.checked)}
/>