87 lines
3.2 KiB
JavaScript
87 lines
3.2 KiB
JavaScript
import { useState } from "react";
|
|
import { Box, Button, Modal } from "@mui/material";
|
|
|
|
// Icon
|
|
import ArrowBottomH from "@/components/icons/ArrowBottomH";
|
|
import Location from "@/components/icons/Location";
|
|
import { styleDefault } from "@/mui";
|
|
import CloseModalD from "@/components/icons/CloseModalD";
|
|
import AutoCompleteSelect from "@/app/component/element/AutoCompleteSelect";
|
|
import ArrowLeftM from "@/components/icons/ArrowLeftM";
|
|
|
|
function ModalSearchCity() {
|
|
|
|
const states = [
|
|
{ label: 'تهران', id: 10 },
|
|
{ label: 'اصفهان', id: 20 },
|
|
{ label: 'مازندران', id: 30 }
|
|
];
|
|
|
|
const cities = [
|
|
{ label: 'شهر یک', id: 10 },
|
|
{ label: 'شهر دو', id: 20 },
|
|
{ label: 'شهر سه', id: 30 }
|
|
];
|
|
|
|
const [open, setOpen] = useState(false);
|
|
const handleOpen = () => setOpen(true);
|
|
const handleClose = () => setOpen(false);
|
|
|
|
return (
|
|
<div>
|
|
{/* Button Modal */}
|
|
<Button
|
|
className="!border-none hover:!bg-transparent"
|
|
onClick={handleOpen}
|
|
variant="contained"
|
|
color="secondary"
|
|
>
|
|
<div className="min-w-[20px] min-h-[20px]">
|
|
<Location />
|
|
</div>
|
|
<p className="text-[#616161] text-[16px] font-medium mx-1">انتخاب شهر</p>
|
|
<ArrowBottomH />
|
|
</Button>
|
|
{/* Content Modal */}
|
|
<Modal
|
|
open={open}
|
|
onClose={handleClose}
|
|
>
|
|
<Box sx={styleDefault}>
|
|
<div
|
|
className="flex justify-end w-full"
|
|
>
|
|
<div className="cursor-pointer" onClick={handleClose}>
|
|
<CloseModalD />
|
|
</div>
|
|
</div>
|
|
<div className="px-2">
|
|
<p className="text-[#525252] mt-4 text-[16px] font-medium text-center">شهر یا استان مورد نظر را انتخاب نمایید:</p>
|
|
<div className="flex flex-col mt-8 mb-14 justify-center items-center gap-10">
|
|
<AutoCompleteSelect
|
|
list={states}
|
|
label='استان'
|
|
/>
|
|
<AutoCompleteSelect
|
|
list={cities}
|
|
label='شهر'
|
|
/>
|
|
</div>
|
|
<div className="w-full flex justify-end">
|
|
<Button
|
|
variant="contained"
|
|
color="primary"
|
|
className="flex !px-3 items-center justify-center gap-1 mr-auto"
|
|
>
|
|
تایید و ادامه
|
|
<ArrowLeftM />
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
</Box>
|
|
</Modal>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default ModalSearchCity |