Can set date of birth and date of death
This commit is contained in:
44
geneit_app/src/widgets/forms/SexSelection.tsx
Normal file
44
geneit_app/src/widgets/forms/SexSelection.tsx
Normal file
@ -0,0 +1,44 @@
|
||||
import {
|
||||
FormControl,
|
||||
FormLabel,
|
||||
RadioGroup,
|
||||
FormControlLabel,
|
||||
Radio,
|
||||
Typography,
|
||||
} from "@mui/material";
|
||||
import { Sex } from "../../api/MemberApi";
|
||||
|
||||
export function SexSelection(p: {
|
||||
readonly?: boolean;
|
||||
current?: Sex;
|
||||
onChange: (s: Sex) => void;
|
||||
}): React.ReactElement {
|
||||
if (p.readonly) {
|
||||
if (p.current === undefined || p.current === null) return <></>;
|
||||
|
||||
return (
|
||||
<Typography
|
||||
variant="body2"
|
||||
display="block"
|
||||
style={{ marginBottom: "15px" }}
|
||||
>
|
||||
Sexe : {p.current === "M" ? "Homme" : "Femme"}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<FormControl style={{ marginBottom: "15px" }}>
|
||||
<FormLabel id="sex-label">Sexe</FormLabel>
|
||||
<RadioGroup
|
||||
row
|
||||
aria-labelledby="sex-label"
|
||||
value={p.current}
|
||||
onChange={(e) => p.onChange(e.target.value as Sex)}
|
||||
>
|
||||
<FormControlLabel value="M" control={<Radio />} label="Homme" />
|
||||
<FormControlLabel value="F" control={<Radio />} label="Femme" />
|
||||
</RadioGroup>
|
||||
</FormControl>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user