fix bug save data in wrong key && change functionality data && clean code component

This commit is contained in:
Ehsan
2025-08-06 18:06:41 +03:30
parent 7e61867e3d
commit 8e4f182868
6 changed files with 111 additions and 73 deletions
@@ -0,0 +1,30 @@
import { FormControlLabel, Switch } from "@mui/material";
function SwitchContent({ data }) {
return (
<div className="flex items-center justify-start gap-[12px]">
<FormControlLabel
control={
<Switch
checked={data.turn}
onChange={(event) => {
changeData(event.target.checked ? 1 : 0, "turn");
}}
/>
}
sx={{
".MuiFormControlLabel-label": {
color: "#3B3B3B",
fontSize: "16px",
fontWeight: 500,
},
marginLeft: "0 !important",
}}
label="فقط پزشکان دارای نوبت"
labelPlacement="start"
/>
</div>
);
}
export default SwitchContent;