modal search and default valud of province and city and handle search && show searched state in clinics page
This commit is contained in:
@@ -5,17 +5,15 @@ import List from "./list";
|
||||
import SmSearch from "../searchHead/SmSearch";
|
||||
import HeadPageList from "@/app/component/head";
|
||||
import specialtiesData from "@/data/specialties.json";
|
||||
import { searchOnList } from "@/helper";
|
||||
|
||||
function SpecialtiesPage() {
|
||||
const [filteredSpecialties, setFilteredSpecialties] = useState(specialtiesData);
|
||||
|
||||
const searchHandler = (e) => {
|
||||
const value = e.target.value
|
||||
setFilteredSpecialties(
|
||||
specialtiesData.filter(item =>
|
||||
item.name.toLowerCase().includes(value)
|
||||
)
|
||||
)
|
||||
searchOnList(specialtiesData, e.target.value, 'name')
|
||||
);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user