diff --git a/components/clinics/head/modal/index.js b/components/clinics/head/modal/index.js index 2d4aa2c..6e88bd6 100644 --- a/components/clinics/head/modal/index.js +++ b/components/clinics/head/modal/index.js @@ -34,7 +34,7 @@ function ModalSearchCity() { }); const updateData = (event, name) => - setSelected({ ...selected, [name]: event.target.innerText }); + setSelected({ ...selected, [name]: event }); return ( <> diff --git a/components/dashboard/userAccount/tabs/detailUser/Form.js b/components/dashboard/userAccount/tabs/detailUser/Form.js index 95d3802..de73d58 100644 --- a/components/dashboard/userAccount/tabs/detailUser/Form.js +++ b/components/dashboard/userAccount/tabs/detailUser/Form.js @@ -11,7 +11,7 @@ import { job, } from "./listSelector"; -function Form({ data, selected, changeData, updateSelect }) { +function Form({ data, changeData, updateSelect }) { return (
diff --git a/components/dashboard/userAccount/tabs/detailUser/index.js b/components/dashboard/userAccount/tabs/detailUser/index.js index 66f886a..430e519 100644 --- a/components/dashboard/userAccount/tabs/detailUser/index.js +++ b/components/dashboard/userAccount/tabs/detailUser/index.js @@ -39,7 +39,6 @@ function DetailUser({ user }) {
diff --git a/components/doctors/modal/Content.js b/components/doctors/modal/Content.js index e1798f7..566f731 100644 --- a/components/doctors/modal/Content.js +++ b/components/doctors/modal/Content.js @@ -1,14 +1,7 @@ import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect"; import RadioContent from "./RadioContent"; import { Switch } from "@mui/material"; - -const specialties = [ - "چشم پزشکی1", - "چشم پزشکی2", - "چشم پزشکی3", - "چشم پزشکی4", - "چشم پزشکی5", -]; +import { category, expertise } from "./listSelector"; const group1 = ["خانم", "آقا", "هر دو"]; const group2 = ["فوق تخصص", "دکترای تخصصی", "متخصص", "دکتری"]; @@ -22,17 +15,15 @@ function Content({ data, setData }) { return (
changeData(event.target.innerText, "expertise")} - list={specialties} + updateData={changeData} + list={category} name="expertise" label="دسته بندی" />
- changeData(event.target.innerText, "expertise") - } - list={specialties} + updateData={changeData} + list={expertise} name="expertise" label="تخصص" /> diff --git a/components/doctors/modal/Radios.js b/components/doctors/modal/Radios.js index 48d9391..976ad47 100644 --- a/components/doctors/modal/Radios.js +++ b/components/doctors/modal/Radios.js @@ -4,6 +4,7 @@ function Radios({ group, value, changeData }) { return ( changeData(e.target.value)} sx={{ "& .MuiFormControlLabel-root": { diff --git a/components/doctors/modal/listSelector.js b/components/doctors/modal/listSelector.js new file mode 100644 index 0000000..d576ea4 --- /dev/null +++ b/components/doctors/modal/listSelector.js @@ -0,0 +1,17 @@ +const category = [ + { label: "چشم پزشکی 1", id: 10 }, + { label: "چشم پزشکی 2", id: 20 }, + { label: "چشم پزشکی 3", id: 30 }, + { label: "چشم پزشکی 4", id: 40 }, + { label: "چشم پزشکی 5", id: 40 }, +]; + +const expertise = [ + { label: "تخصص 1", id: 10 }, + { label: "تخصص 2", id: 20 }, + { label: "تخصص 3", id: 30 }, + { label: "تخصص 4", id: 40 }, + { label: "تخصص 5", id: 40 }, +]; + +export { category, expertise }; diff --git a/components/home/search/modal/index.js b/components/home/search/modal/index.js index 204dcdf..e3af4f1 100644 --- a/components/home/search/modal/index.js +++ b/components/home/search/modal/index.js @@ -34,7 +34,7 @@ function ModalSearchCity() { }); const updateData = (event, name) => - setSelected({ ...selected, [name]: event.target.innerText }); + setSelected({ ...selected, [name]: event }); return ( <>