59 lines
1.9 KiB
JavaScript
59 lines
1.9 KiB
JavaScript
import { Button, ButtonGroup, TextField } from "@mui/material";
|
|
import SearchD from "@/components/icons/SearchD";
|
|
import ModalSearchCity from "@/app/component/modalSearchCity";
|
|
import { useState } from "react";
|
|
import ButtonFilter from "@/app/component/modalSearchCity/ButtonFilter";
|
|
|
|
function SearchBar({ selected, setSelected, state, handleSearch }) {
|
|
const [open, setOpen] = useState(false);
|
|
|
|
return (
|
|
<ButtonGroup
|
|
variant="contained"
|
|
className="
|
|
!bg-[#FFF] !w-full sm:!w-2/3 !mt-[30px] !rounded-lg !overflow-hidden flex items-center
|
|
!shadow-[0px_1px_24.8px_0px_rgba(204,_204,_204,_0.18)]
|
|
!h-fit !pl-1"
|
|
>
|
|
<ModalSearchCity
|
|
open={open}
|
|
state={state}
|
|
setOpen={setOpen}
|
|
selected={selected}
|
|
setSelected={setSelected}
|
|
handleSearch={handleSearch}
|
|
>
|
|
<ButtonFilter setOpen={setOpen} selected={selected} />
|
|
</ModalSearchCity>
|
|
<TextField
|
|
variant="standard"
|
|
onChange={(e) => handleSearch(e.target.value)}
|
|
InputProps={{
|
|
disableUnderline: true,
|
|
}}
|
|
sx={{
|
|
background: "transparent !important",
|
|
"& .MuiInputBase-input": { color: "#7E7E7E" },
|
|
"& .MuiInput-root": { borderBottom: "none" },
|
|
"& .MuiInputBase-root": { height: "100%" },
|
|
}}
|
|
placeholder="جستجوی تخصص"
|
|
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]`}
|
|
/>
|
|
<Button
|
|
onClick={handleSearch}
|
|
className="
|
|
!rounded-[4px] !gap-2.5 !p-2 md:!p-3 lg:!p-4 !min-w-fit
|
|
!w-[38px] sm:!w-[44px] md:!w-[50px] lg:!w-[56px]
|
|
!h-[38px] sm:!h-[44px] md:!h-[50px] lg:!h-[56px]
|
|
"
|
|
>
|
|
<SearchD />
|
|
</Button>
|
|
</ButtonGroup>
|
|
);
|
|
}
|
|
|
|
export default SearchBar;
|