update field doctors, cities, states and specialties
This commit is contained in:
@@ -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} />
|
||||
|
||||
Reference in New Issue
Block a user