diff --git a/components/doctors/index.js b/components/doctors/index.js
index 8455fed..d947f2a 100644
--- a/components/doctors/index.js
+++ b/components/doctors/index.js
@@ -1,9 +1,21 @@
-import LocationD from "../icons/LocationD";
-import ListDoctors from "./listDoctors";
+'use client';
+
+import { useState } from "react";
import SearchBar from "./search";
import SortList from "./sortlist";
+import ListDoctors from "./listDoctors";
+
+import LocationD from "../icons/LocationD";
function DoctorsPage() {
+
+ const [data, setData] = useState({
+ expertise: '',
+ gender: 0,
+ degree: 0,
+ turn: true
+ });
+
return (
@@ -12,8 +24,8 @@ function DoctorsPage() {
خوزستان / اهواز
-
-
+
+
diff --git a/components/doctors/modal/Content.js b/components/doctors/modal/Content.js
index ae167ee..19a94a6 100644
--- a/components/doctors/modal/Content.js
+++ b/components/doctors/modal/Content.js
@@ -1,19 +1,50 @@
import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect";
-import Radios from "./Radios";
+import RadioContent from "./RadioContent";
+import { Button, Switch } from "@mui/material";
-const specialties = ['چشم پزشکی', 'چشم پزشکی', 'چشم پزشکی', 'چشم پزشکی', 'چشم پزشکی'];
+const specialties = ['چشم پزشکی1', 'چشم پزشکی2', 'چشم پزشکی3', 'چشم پزشکی4', 'چشم پزشکی5'];
const group1 = ['خانم', 'آقا', 'هر دو'];
+const group2 = ['فوق تخصص', 'دکترای تخصصی', 'متخصص', 'دکتری'];
+
+const label = { inputProps: { 'aria-label': 'Switch demo' } };
+
+function Content({ data, setData }) {
+
+ const changeData = (value, name) => {
+ setData({ ...data, [name]: value })
+ };
-function Content() {
return (
changeData(event.target.innerText, 'expertise')}
list={specialties}
+ name='expertise'
label='تخصص'
/>
-
-
جنسیت پزشک
-
+
+
changeData(+value, 'gender')}
+ value={data.gender}
+ text='جنسیت پزشک'
+ group={group1}
+
+ />
+
+ changeData(+value, 'degree')}
+ value={data.degree}
+ text='درجه علمی'
+ group={group2}
+ />
+
+
+
فقط پزشکان دارای نوبت
+
changeData(event.target.checked, 'turn')}
+ />
+
)
diff --git a/components/doctors/modal/FilterModal.js b/components/doctors/modal/FilterModal.js
index e0bfc6c..6181079 100644
--- a/components/doctors/modal/FilterModal.js
+++ b/components/doctors/modal/FilterModal.js
@@ -6,9 +6,9 @@ import { Button, Modal } from "@mui/material";
import { useState } from "react";
import Content from "./Content";
-function FilterModal({ children }) {
+function FilterModal({ data, setData, children }) {
- const [open, setOpen] = useState(true);
+ const [open, setOpen] = useState(false);
const handleOpen = () => setOpen(true);
const handleClose = () => setOpen(false);
@@ -26,22 +26,34 @@ function FilterModal({ children }) {
>
-
-
فیلترها
-
+
+
+ اعمال تغییرات
-
>
diff --git a/components/doctors/modal/RadioContent.js b/components/doctors/modal/RadioContent.js
new file mode 100644
index 0000000..74548bd
--- /dev/null
+++ b/components/doctors/modal/RadioContent.js
@@ -0,0 +1,16 @@
+import Radios from "./Radios"
+
+function RadioContent({ group, text, value, changeData }) {
+ return (
+
+ )
+}
+
+export default RadioContent
\ No newline at end of file
diff --git a/components/doctors/modal/Radios.js b/components/doctors/modal/Radios.js
index 43996c8..4911743 100644
--- a/components/doctors/modal/Radios.js
+++ b/components/doctors/modal/Radios.js
@@ -1,10 +1,27 @@
import { FormControlLabel, Radio, RadioGroup } from "@mui/material"
-function Radios({ group }) {
+function Radios({ group, value, changeData }) {
return (
-
+ changeData(e.target.value)}
+ sx={{
+ '& .MuiFormControlLabel-root': {
+ marginRight: '0 !important',
+ transform: 'translateX(9px)'
+ }
+ }}
+ >
{group.map((item, idx) => (
- } label={item} />
+
+ }
+ label={item}
+ value={idx}
+ key={idx}
+ />
))}
)
diff --git a/components/doctors/search/index.js b/components/doctors/search/index.js
index 8dd7db4..671269e 100644
--- a/components/doctors/search/index.js
+++ b/components/doctors/search/index.js
@@ -4,7 +4,7 @@ import ArrowBottomD from "@/components/icons/ArrowBottomD";
import SearchD from "@/components/icons/SearchD";
import FilterModal from "../modal/FilterModal";
-function SearchBar() {
+function SearchBar({ data, setData }) {
return (
-
+
{
return (
-
+
@@ -41,9 +43,19 @@ function SelectSort() {
}
}}
>
-
-
-
+ {listSort.map((item, idx) => (
+
+
+ {listSort.length > idx + 1 && (
+
+ )}
+
+ ))}
)
}
diff --git a/components/doctors/sortlist/index.js b/components/doctors/sortlist/index.js
index 23785b8..57b3e2a 100644
--- a/components/doctors/sortlist/index.js
+++ b/components/doctors/sortlist/index.js
@@ -1,12 +1,15 @@
'use client';
+import FilterModal from "../modal/FilterModal";
import FilterBtn from "./FilterBtn";
import SelectSort from "./SelectSort";
-function SortList() {
+function SortList({ data, setData }) {
return (
-
+
+
+
)
diff --git a/components/home/index.js b/components/home/index.js
index 5f7ea0c..7b636f0 100644
--- a/components/home/index.js
+++ b/components/home/index.js
@@ -7,7 +7,7 @@ import FrequentSearches from "./FrequentSearches";
function HomePage() {
return (
-