update field doctors, cities, states and specialties

This commit is contained in:
ehsan
2025-09-25 17:06:57 +03:30
parent 74c6cf7b6b
commit 0db121150d
15 changed files with 336 additions and 200 deletions
+2 -10
View File
@@ -5,25 +5,17 @@ import { useState } from "react";
import List from "./list";
import SearchBar from "./head/SearchBar";
import HeadPageList from "@/app/component/head";
import { useRouter } from "next/navigation";
import specialtiesData from "@/data/specialties.json";
function ClinicsPage({ clinics, matchedCity, matchedState }) {
const router = useRouter();
const [filteredClinics, setFilteredClinics] = useState(clinics);
const [selected, setSelected] = useState({
province: matchedState?.name || "",
city: matchedCity?.name || "",
specialty: "",
});
const handleSearch = (value) => {
// const current = new URLSearchParams(window.location.search);
// current.set("search", value);
// const queryString = current.toString();
// router.push(`/clinics?${queryString}`);
};
return (
<div>
<HeadPageList
@@ -34,8 +26,8 @@ function ClinicsPage({ clinics, matchedCity, matchedState }) {
selected={selected}
state={matchedState}
setSelected={setSelected}
handleSearch={handleSearch}
specialties={specialtiesData}
setFilteredClinics={setFilteredClinics}
/>
</HeadPageList>
<List selected={selected} clinics={filteredClinics} />