change component file & set data in url & handle remove all variable

This commit is contained in:
Ehsan
2025-05-16 17:19:38 +03:30
parent a016d3319a
commit 7fddf65026
5 changed files with 62 additions and 42 deletions
+10 -8
View File
@@ -8,6 +8,14 @@ import ListDoctors from "./listDoctors";
import LocationD from "../icons/LocationD";
import ModalSearchCity from "@/app/component/modalSearchCity";
const defaultData = {
category: "",
expertise: "",
turn: true,
gender: "هر دو",
degree: "متخصص",
}
function DoctorsPage({ params, matchedCity, matchedState }) {
const [loading, setLoading] = useState(true);
const [open, setOpen] = useState(false);
@@ -16,13 +24,7 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
city: matchedCity?.name || params?.city,
});
const [data, setData] = useState({
category: "",
expertise: "",
turn: true,
gender: "خانم",
degree: "فوق تخصص",
});
const [data, setData] = useState(defaultData);
useEffect(() => {
setTimeout(() => {
@@ -53,7 +55,7 @@ function DoctorsPage({ params, matchedCity, matchedState }) {
</Button>
</ModalSearchCity>
<div className="flex flex-col lg:flex-row items-start lg:items-center justify-center gap-[24px] lg:gap-[32px] w-full">
<SearchBar data={data} setData={setData} params={params} />
<SearchBar data={data} setData={setData} params={params} defaultData={defaultData} />
<SortList data={data} setData={setData} />
</div>
</div>