install and handle casle & prevent page dashboard & handle register and code verfication & get data in clinics page

This commit is contained in:
Ehsan
2025-05-27 03:40:06 +03:30
parent a9f98aea3b
commit d95815d4aa
27 changed files with 336 additions and 206 deletions
+3 -11
View File
@@ -1,15 +1,13 @@
"use client";
import { useEffect, useState } from "react";
import { useState } from "react";
import List from "./list";
import { searchOnList } from "@/helper";
import SearchBar from "./head/SearchBar";
import clinics from "@/data/clinics.json";
import HeadPageList from "@/app/component/head";
function ClinicsPage({ matchedCity, matchedState }) {
const [loading, setLoading] = useState(true);
function ClinicsPage({ clinics, matchedCity, matchedState }) {
const [filteredClinics, setFilteredClinics] = useState(clinics);
const [selected, setSelected] = useState({
@@ -17,12 +15,6 @@ function ClinicsPage({ matchedCity, matchedState }) {
city: matchedCity?.name || "",
});
useEffect(() => {
setTimeout(() => {
setLoading(false);
}, 2000);
}, []);
const handleSearch = (value) => {
const searchOnName = searchOnList(clinics, value, "title");
const searchOnLocation = searchOnList(searchOnName, selected.city, "city");
@@ -42,7 +34,7 @@ function ClinicsPage({ matchedCity, matchedState }) {
handleSearch={handleSearch}
/>
</HeadPageList>
<List loading={loading} selected={selected} clinics={filteredClinics} />
<List selected={selected} clinics={filteredClinics} />
</div>
);
}