add state of page in url, add location and working_days on list in clinics page, fix update list clinic with page and limit value, hide pagination when list of clinic is empty, round image of doctor and appo in doctor item
This commit is contained in:
@@ -14,7 +14,7 @@ import cities from "@/data/city.json";
|
||||
|
||||
function ClinicsPage({ clinics, matchedCity, matchedState }) {
|
||||
const searchParams = useSearchParams();
|
||||
const [filteredClinics, setFilteredClinics] = useState(clinics.data);
|
||||
const [filteredClinics, setFilteredClinics] = useState(clinics?.data);
|
||||
|
||||
const selectedState = searchParams.get("state") || matchedState?.name;
|
||||
const selectedCity =
|
||||
@@ -37,6 +37,7 @@ function ClinicsPage({ clinics, matchedCity, matchedState }) {
|
||||
detail="در قسمت زیر می توانید کلینیک مورد نظر خود را جستجو نمایید"
|
||||
>
|
||||
<SearchBar
|
||||
limit={12}
|
||||
selected={selected}
|
||||
state={matchedState}
|
||||
setSelected={setSelected}
|
||||
@@ -47,7 +48,7 @@ function ClinicsPage({ clinics, matchedCity, matchedState }) {
|
||||
<List
|
||||
limit={12}
|
||||
selected={selected}
|
||||
pages={clinics.page}
|
||||
pages={clinics?.page || []}
|
||||
clinics={filteredClinics}
|
||||
setFilteredClinics={setFilteredClinics}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user