change design dashboards all page and search clinics
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import SmSearch from "@/components/searchHead/SmSearch";
|
import SmSearch from "@/components/searchHead/smSearch";
|
||||||
import List from "./List";
|
import List from "./List";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { searchOnList } from "@/helper";
|
import { searchOnList } from "@/helper";
|
||||||
|
|||||||
@@ -3,8 +3,15 @@ import SearchD from "@/components/icons/SearchD";
|
|||||||
import ModalSearchCity from "@/app/component/modalSearchCity";
|
import ModalSearchCity from "@/app/component/modalSearchCity";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import ButtonFilter from "@/app/component/modalSearchCity/ButtonFilter";
|
import ButtonFilter from "@/app/component/modalSearchCity/ButtonFilter";
|
||||||
|
import AutoCompleteSearch from "@/components/searchHead/smSearch/AutoCompleteSearch";
|
||||||
|
|
||||||
function SearchBar({ selected, setSelected, state, handleSearch }) {
|
function SearchBar({
|
||||||
|
selected,
|
||||||
|
setSelected,
|
||||||
|
specialties,
|
||||||
|
state,
|
||||||
|
handleSearch,
|
||||||
|
}) {
|
||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -25,7 +32,12 @@ function SearchBar({ selected, setSelected, state, handleSearch }) {
|
|||||||
>
|
>
|
||||||
<ButtonFilter setOpen={setOpen} selected={selected} />
|
<ButtonFilter setOpen={setOpen} selected={selected} />
|
||||||
</ModalSearchCity>
|
</ModalSearchCity>
|
||||||
<TextField
|
<AutoCompleteSearch
|
||||||
|
data={specialties}
|
||||||
|
placeholder="جستجوی تخصص"
|
||||||
|
handleSearch={handleSearch}
|
||||||
|
/>
|
||||||
|
{/* <TextField
|
||||||
variant="standard"
|
variant="standard"
|
||||||
onChange={(e) => handleSearch(e.target.value)}
|
onChange={(e) => handleSearch(e.target.value)}
|
||||||
InputProps={{
|
InputProps={{
|
||||||
@@ -40,7 +52,7 @@ function SearchBar({ selected, setSelected, state, handleSearch }) {
|
|||||||
placeholder="جستجوی تخصص"
|
placeholder="جستجوی تخصص"
|
||||||
dir="rtl"
|
dir="rtl"
|
||||||
className={`!shadow-none !w-full !min-w-3 !px-5 !h-full bg-[#FAFAFA] !text-[14px] md:!text-[16px] lg:!min-w-[50%] !rounded-0 !font-normal !text-[#6C757D]`}
|
className={`!shadow-none !w-full !min-w-3 !px-5 !h-full bg-[#FAFAFA] !text-[14px] md:!text-[16px] lg:!min-w-[50%] !rounded-0 !font-normal !text-[#6C757D]`}
|
||||||
/>
|
/> */}
|
||||||
<Button
|
<Button
|
||||||
onClick={handleSearch}
|
onClick={handleSearch}
|
||||||
className="
|
className="
|
||||||
|
|||||||
@@ -3,11 +3,13 @@
|
|||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
import List from "./list";
|
import List from "./list";
|
||||||
import { searchOnList } from "@/helper";
|
|
||||||
import SearchBar from "./head/SearchBar";
|
import SearchBar from "./head/SearchBar";
|
||||||
import HeadPageList from "@/app/component/head";
|
import HeadPageList from "@/app/component/head";
|
||||||
|
import { useRouter } from "next/navigation";
|
||||||
|
import specialtiesData from "@/data/specialties.json";
|
||||||
|
|
||||||
function ClinicsPage({ clinics, matchedCity, matchedState }) {
|
function ClinicsPage({ clinics, matchedCity, matchedState }) {
|
||||||
|
const router = useRouter();
|
||||||
const [filteredClinics, setFilteredClinics] = useState(clinics);
|
const [filteredClinics, setFilteredClinics] = useState(clinics);
|
||||||
|
|
||||||
const [selected, setSelected] = useState({
|
const [selected, setSelected] = useState({
|
||||||
@@ -16,9 +18,13 @@ function ClinicsPage({ clinics, matchedCity, matchedState }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const handleSearch = (value) => {
|
const handleSearch = (value) => {
|
||||||
const searchOnName = searchOnList(clinics, value, "title");
|
const current = new URLSearchParams(window.location.search);
|
||||||
const searchOnLocation = searchOnList(searchOnName, selected.city, "city");
|
current.set("search", value);
|
||||||
setFilteredClinics(searchOnLocation);
|
const queryString = current.toString();
|
||||||
|
router.push(`/clinics?${queryString}`);
|
||||||
|
// const searchOnName = searchOnList(clinics, value, "title");
|
||||||
|
// const searchOnLocation = searchOnList(searchOnName, selected.city, "city");
|
||||||
|
// setFilteredClinics(searchOnLocation);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -32,6 +38,7 @@ function ClinicsPage({ clinics, matchedCity, matchedState }) {
|
|||||||
setSelected={setSelected}
|
setSelected={setSelected}
|
||||||
state={matchedState?.name}
|
state={matchedState?.name}
|
||||||
handleSearch={handleSearch}
|
handleSearch={handleSearch}
|
||||||
|
specialties={specialtiesData}
|
||||||
/>
|
/>
|
||||||
</HeadPageList>
|
</HeadPageList>
|
||||||
<List selected={selected} clinics={filteredClinics} />
|
<List selected={selected} clinics={filteredClinics} />
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import React from "react";
|
|
||||||
|
|
||||||
function Head({ text, children }) {
|
function Head({ text, children }) {
|
||||||
return (
|
return (
|
||||||
<div className="w-full flex mb-[40px] items-center justify-between">
|
<div className="w-full flex mb-[40px] items-center justify-between">
|
||||||
<p className="text-[#525252] dark:text-[#A1A1A1] text-[20px] font-bold">
|
<p className="text-[#525252] dark:text-[#A1A1A1] text-[20px] font-bold">
|
||||||
{text}
|
{text}
|
||||||
</p>
|
</p>
|
||||||
{children}
|
<div className="flex items-center justify-end gap-4">{children}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import UpdateList from "@/components/icons/UpdateList";
|
||||||
|
import { Button } from "@mui/material";
|
||||||
|
|
||||||
|
function UpdateBtn() {
|
||||||
|
return (
|
||||||
|
<Button
|
||||||
|
variant="outlined"
|
||||||
|
className="!border-[#5559CE] !border-[2px] !flex !items-center !justify-center !gap-2 !text-[14px] md:!text-[14px] !font-medium"
|
||||||
|
>
|
||||||
|
<UpdateList />
|
||||||
|
آپدیت کردن
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default UpdateBtn;
|
||||||
@@ -5,6 +5,7 @@ import TrashB from "@/components/icons/TrashB";
|
|||||||
import { Button, TableCell, TableRow } from "@mui/material";
|
import { Button, TableCell, TableRow } from "@mui/material";
|
||||||
import Head from "../../components/Head";
|
import Head from "../../components/Head";
|
||||||
import AddBtn from "../../components/AddBtn";
|
import AddBtn from "../../components/AddBtn";
|
||||||
|
import UpdateBtn from "../../components/UpdateBtn";
|
||||||
|
|
||||||
function Allergies({ data }) {
|
function Allergies({ data }) {
|
||||||
const tableHead = ["ردیف", "ماده آلرژیزا", "واکنش", "شدت", ""];
|
const tableHead = ["ردیف", "ماده آلرژیزا", "واکنش", "شدت", ""];
|
||||||
@@ -13,6 +14,7 @@ function Allergies({ data }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head text="لیست آلرژی ها">
|
<Head text="لیست آلرژی ها">
|
||||||
|
<UpdateBtn />
|
||||||
<AddBtn />
|
<AddBtn />
|
||||||
</Head>
|
</Head>
|
||||||
<CustomTable
|
<CustomTable
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import CustomTable from "@/app/component/CustomTable";
|
import CustomTable from "@/app/component/CustomTable";
|
||||||
import TextLoading from "@/app/component/loading/Text";
|
import TextLoading from "@/app/component/loading/Text";
|
||||||
import { Button, Switch, TableCell, TableRow } from "@mui/material";
|
import { Switch, TableCell, TableRow } from "@mui/material";
|
||||||
import Head from "../../components/Head";
|
import Head from "../../components/Head";
|
||||||
import UpdateList from "@/components/icons/UpdateList";
|
import UpdateBtn from "../../components/UpdateBtn";
|
||||||
import AddBtn from "../../components/AddBtn";
|
|
||||||
|
|
||||||
function Disease({ data }) {
|
function Disease({ data }) {
|
||||||
const tableHead = ["ردیف", "اسم", "وضعیت", ""];
|
const tableHead = ["ردیف", "اسم", "وضعیت", ""];
|
||||||
@@ -12,16 +11,7 @@ function Disease({ data }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head text="لیست بیماری ها" add={false}>
|
<Head text="لیست بیماری ها" add={false}>
|
||||||
<div className="flex items-center justify-end gap-4">
|
<UpdateBtn />
|
||||||
<Button
|
|
||||||
variant="outlined"
|
|
||||||
className="!border-[#5559CE] !border-[2px] !flex !items-center !justify-center !gap-2 !text-[14px] md:!text-[14px] !font-medium"
|
|
||||||
>
|
|
||||||
<UpdateList />
|
|
||||||
آپدیت کردن
|
|
||||||
</Button>
|
|
||||||
<AddBtn />
|
|
||||||
</div>
|
|
||||||
</Head>
|
</Head>
|
||||||
<CustomTable
|
<CustomTable
|
||||||
zeroRadius={true}
|
zeroRadius={true}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import TrashB from "@/components/icons/TrashB";
|
|||||||
import { Button, TableCell, TableRow } from "@mui/material";
|
import { Button, TableCell, TableRow } from "@mui/material";
|
||||||
import Head from "../../components/Head";
|
import Head from "../../components/Head";
|
||||||
import AddBtn from "../../components/AddBtn";
|
import AddBtn from "../../components/AddBtn";
|
||||||
|
import UpdateBtn from "../../components/UpdateBtn";
|
||||||
|
|
||||||
function FamilyHistory({ data }) {
|
function FamilyHistory({ data }) {
|
||||||
const tableHead = ["ردیف", "بیماری", "نسبت خانوادگی", ""];
|
const tableHead = ["ردیف", "بیماری", "نسبت خانوادگی", ""];
|
||||||
@@ -13,6 +14,7 @@ function FamilyHistory({ data }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head text="لیست سابقه خانوادگی بیماری">
|
<Head text="لیست سابقه خانوادگی بیماری">
|
||||||
|
<UpdateBtn />
|
||||||
<AddBtn />
|
<AddBtn />
|
||||||
</Head>
|
</Head>
|
||||||
<CustomTable
|
<CustomTable
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import TrashB from "@/components/icons/TrashB";
|
|||||||
import { Button, TableCell, TableRow } from "@mui/material";
|
import { Button, TableCell, TableRow } from "@mui/material";
|
||||||
import Head from "../../components/Head";
|
import Head from "../../components/Head";
|
||||||
import AddBtn from "../../components/AddBtn";
|
import AddBtn from "../../components/AddBtn";
|
||||||
|
import UpdateBtn from "../../components/UpdateBtn";
|
||||||
|
|
||||||
function Medications({ data }) {
|
function Medications({ data }) {
|
||||||
const tableHead = ["ردیف", "نام دارو", "دوز مصرفی", "تعداد و زمان مصرف", ""];
|
const tableHead = ["ردیف", "نام دارو", "دوز مصرفی", "تعداد و زمان مصرف", ""];
|
||||||
@@ -13,6 +14,7 @@ function Medications({ data }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head text="لیست دارو های مصرفی">
|
<Head text="لیست دارو های مصرفی">
|
||||||
|
<UpdateBtn />
|
||||||
<AddBtn />
|
<AddBtn />
|
||||||
</Head>
|
</Head>
|
||||||
<CustomTable
|
<CustomTable
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import TrashB from "@/components/icons/TrashB";
|
|||||||
import { Button, TableCell, TableRow, Tooltip } from "@mui/material";
|
import { Button, TableCell, TableRow, Tooltip } from "@mui/material";
|
||||||
import Head from "../../components/Head";
|
import Head from "../../components/Head";
|
||||||
import AddBtn from "../../components/AddBtn";
|
import AddBtn from "../../components/AddBtn";
|
||||||
|
import UpdateBtn from "../../components/UpdateBtn";
|
||||||
|
|
||||||
function Relatives({ data }) {
|
function Relatives({ data }) {
|
||||||
const tableHead = ["ردیف", "نام", "نسبت", "شماره تماس", "آدرس", ""];
|
const tableHead = ["ردیف", "نام", "نسبت", "شماره تماس", "آدرس", ""];
|
||||||
@@ -13,6 +14,7 @@ function Relatives({ data }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head text="لیست بستگان">
|
<Head text="لیست بستگان">
|
||||||
|
<UpdateBtn />
|
||||||
<AddBtn />
|
<AddBtn />
|
||||||
</Head>
|
</Head>
|
||||||
<CustomTable
|
<CustomTable
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import TrashB from "@/components/icons/TrashB";
|
|||||||
import { Button, TableCell, TableRow } from "@mui/material";
|
import { Button, TableCell, TableRow } from "@mui/material";
|
||||||
import Head from "../../components/Head";
|
import Head from "../../components/Head";
|
||||||
import AddBtn from "../../components/AddBtn";
|
import AddBtn from "../../components/AddBtn";
|
||||||
|
import UpdateBtn from "../../components/UpdateBtn";
|
||||||
|
|
||||||
function Surgeries({ data }) {
|
function Surgeries({ data }) {
|
||||||
const tableHead = [
|
const tableHead = [
|
||||||
@@ -19,6 +20,7 @@ function Surgeries({ data }) {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Head text="لیست جراحی ها">
|
<Head text="لیست جراحی ها">
|
||||||
|
<UpdateBtn />
|
||||||
<AddBtn />
|
<AddBtn />
|
||||||
</Head>
|
</Head>
|
||||||
<CustomTable
|
<CustomTable
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ function LogInPage({ setIsSendMsg, num, setNum, setUuid, matchedCity }) {
|
|||||||
<Field
|
<Field
|
||||||
dir="ltr"
|
dir="ltr"
|
||||||
value={num}
|
value={num}
|
||||||
type="string"
|
type="tel"
|
||||||
error={!error.valid}
|
error={!error.valid}
|
||||||
spaceNull={true}
|
spaceNull={true}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
import SearchD from "@/components/icons/SearchD";
|
|
||||||
import { Autocomplete, TextField, Button, ButtonGroup } from "@mui/material";
|
|
||||||
import { useState } from "react";
|
|
||||||
|
|
||||||
function SmSearch({ placeholder, handleSearch, data }) {
|
|
||||||
const [inputValue, setInputValue] = useState("");
|
|
||||||
const [selectedOption, setSelectedOption] = useState(null);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ButtonGroup
|
|
||||||
variant="contained"
|
|
||||||
className="!bg-[#FFF] !w-full lg:!w-2/3 !mt-[15px] !rounded-lg !overflow-hidden
|
|
||||||
flex items-center !shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
|
|
||||||
!h-fit !p-1"
|
|
||||||
>
|
|
||||||
<Autocomplete
|
|
||||||
freeSolo
|
|
||||||
options={data}
|
|
||||||
getOptionLabel={(option) => option.name}
|
|
||||||
inputValue={inputValue}
|
|
||||||
className="!w-full"
|
|
||||||
onInputChange={(event, newInputValue) => {
|
|
||||||
setInputValue(newInputValue);
|
|
||||||
handleSearch(newInputValue);
|
|
||||||
}}
|
|
||||||
onChange={(event, newValue) => {
|
|
||||||
setSelectedOption(newValue);
|
|
||||||
handleSearch(newValue ? newValue.name : "");
|
|
||||||
}}
|
|
||||||
renderInput={(params) => (
|
|
||||||
<TextField
|
|
||||||
{...params}
|
|
||||||
variant="standard"
|
|
||||||
placeholder={placeholder}
|
|
||||||
dir="rtl"
|
|
||||||
InputProps={{
|
|
||||||
...params.InputProps,
|
|
||||||
disableUnderline: true,
|
|
||||||
style: { height: "100%" },
|
|
||||||
}}
|
|
||||||
sx={{
|
|
||||||
background: "transparent !important",
|
|
||||||
"& .MuiInputBase-input": {
|
|
||||||
background: "#FAFAFA",
|
|
||||||
color: "#6C757D",
|
|
||||||
padding: "0 16px",
|
|
||||||
fontSize: "14px",
|
|
||||||
fontFamily: "inherit",
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
className="!shadow-none !w-full !px-5 !h-full !text-[14px] md:!text-[16px] !min-w-[50%] !rounded-0 !font-normal"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
onClick={() => handleSearch(inputValue)}
|
|
||||||
className="
|
|
||||||
!rounded-[4px] !gap-2.5 !p-2 md:!p-3 lg:!p-4
|
|
||||||
!w-[38px] sm:!w-[44px] md:!w-[50px] lg:!w-[56px]
|
|
||||||
!h-[38px] sm:!h-[44px] md:!h-[50px] lg:!h-[56px]
|
|
||||||
!min-w-[38px] sm:!min-w-[44px] md:!min-w-[50px] lg:!min-w-[56px]
|
|
||||||
!min-h-[38px] sm:!min-h-[44px] md:!min-h-[50px] lg:!min-h-[56px]
|
|
||||||
"
|
|
||||||
>
|
|
||||||
<SearchD />
|
|
||||||
</Button>
|
|
||||||
</ButtonGroup>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SmSearch;
|
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { Autocomplete, TextField } from "@mui/material";
|
||||||
|
|
||||||
|
function AutoCompleteSearch({
|
||||||
|
data,
|
||||||
|
inputValue,
|
||||||
|
placeholder,
|
||||||
|
handleSearch,
|
||||||
|
setInputValue,
|
||||||
|
setSelectedOption,
|
||||||
|
}) {
|
||||||
|
return (
|
||||||
|
<Autocomplete
|
||||||
|
freeSolo
|
||||||
|
options={data}
|
||||||
|
getOptionLabel={(option) => option.name}
|
||||||
|
inputValue={inputValue}
|
||||||
|
className="!w-full"
|
||||||
|
onInputChange={(event, newInputValue) => {
|
||||||
|
setInputValue && setInputValue(newInputValue);
|
||||||
|
handleSearch(newInputValue);
|
||||||
|
}}
|
||||||
|
onChange={(event, newValue) => {
|
||||||
|
setSelectedOption(newValue);
|
||||||
|
handleSearch(newValue ? newValue.name : "");
|
||||||
|
}}
|
||||||
|
renderInput={(params) => (
|
||||||
|
<TextField
|
||||||
|
{...params}
|
||||||
|
variant="standard"
|
||||||
|
placeholder={placeholder}
|
||||||
|
dir="rtl"
|
||||||
|
InputProps={{
|
||||||
|
...params.InputProps,
|
||||||
|
disableUnderline: true,
|
||||||
|
style: { height: "100%" },
|
||||||
|
}}
|
||||||
|
sx={{
|
||||||
|
background: "transparent !important",
|
||||||
|
"& .MuiInputBase-input": {
|
||||||
|
background: "#FAFAFA",
|
||||||
|
color: "#6C757D",
|
||||||
|
padding: "0 16px",
|
||||||
|
fontSize: "14px",
|
||||||
|
fontFamily: "inherit",
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
className="!shadow-none !w-full !px-5 !h-full !text-[14px] md:!text-[16px] !min-w-[50%] !rounded-0 !font-normal"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default AutoCompleteSearch;
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import SearchD from "@/components/icons/SearchD";
|
||||||
|
import { Button, ButtonGroup } from "@mui/material";
|
||||||
|
import { useState } from "react";
|
||||||
|
import AutoCompleteSearch from "./AutoCompleteSearch";
|
||||||
|
|
||||||
|
function SmSearch({ placeholder, handleSearch, data }) {
|
||||||
|
const [inputValue, setInputValue] = useState("");
|
||||||
|
const [selectedOption, setSelectedOption] = useState(null);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ButtonGroup
|
||||||
|
variant="contained"
|
||||||
|
className="!bg-[#FFF] !w-full lg:!w-2/3 !mt-[15px] !rounded-lg !overflow-hidden
|
||||||
|
flex items-center !shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
|
||||||
|
!h-fit !p-1"
|
||||||
|
>
|
||||||
|
<AutoCompleteSearch
|
||||||
|
data={data}
|
||||||
|
inputValue={inputValue}
|
||||||
|
placeholder={placeholder}
|
||||||
|
handleSearch={handleSearch}
|
||||||
|
setInputValue={setInputValue}
|
||||||
|
setSelectedOption={setSelectedOption}
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
onClick={() => handleSearch(inputValue)}
|
||||||
|
className="
|
||||||
|
!rounded-[4px] !gap-2.5 !p-2 md:!p-3 lg:!p-4
|
||||||
|
!w-[38px] sm:!w-[44px] md:!w-[50px] lg:!w-[56px]
|
||||||
|
!h-[38px] sm:!h-[44px] md:!h-[50px] lg:!h-[56px]
|
||||||
|
!min-w-[38px] sm:!min-w-[44px] md:!min-w-[50px] lg:!min-w-[56px]
|
||||||
|
!min-h-[38px] sm:!min-h-[44px] md:!min-h-[50px] lg:!min-h-[56px]
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<SearchD />
|
||||||
|
</Button>
|
||||||
|
</ButtonGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default SmSearch;
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import List from "./list";
|
import List from "./list";
|
||||||
import SmSearch from "../searchHead/SmSearch";
|
import SmSearch from "../searchHead/smSearch";
|
||||||
import HeadPageList from "@/app/component/head";
|
import HeadPageList from "@/app/component/head";
|
||||||
import specialtiesData from "@/data/specialties.json";
|
import specialtiesData from "@/data/specialties.json";
|
||||||
import { searchOnList } from "@/helper";
|
import { searchOnList } from "@/helper";
|
||||||
|
|||||||
+1
-1
@@ -142,7 +142,7 @@ export function validatePhoneNumber(input) {
|
|||||||
|
|
||||||
export const searchOnList = (list, value, name) => {
|
export const searchOnList = (list, value, name) => {
|
||||||
let newList = list;
|
let newList = list;
|
||||||
newList = list.filter((item) => item[name].toLowerCase().includes(value));
|
newList = list.filter((item) => item[name]?.toLowerCase()?.includes(value));
|
||||||
return newList;
|
return newList;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user