fix(doctors): improve filter performance and resolve modal closing issues

This commit is contained in:
hamed
2026-06-21 15:47:37 +03:30
parent 2fc74a664e
commit cb13ba3f45
10 changed files with 232 additions and 58 deletions
+3 -9
View File
@@ -3,7 +3,6 @@ import { Button } from "@mui/material";
// Icon
import CloseModalD from "@/components/icons/CloseModalD";
import ArrowLeftM from "@/components/icons/ArrowLeftM";
import { useState } from "react";
import AddressSelector from "./AddressSelector";
import { getStateInfoClient } from "@/lib/getStateInfoClient";
@@ -16,14 +15,10 @@ function Content({
setDataInURL,
filteredCities,
}) {
const [loading, setLoading] = useState(false);
const { matchedState } = getStateInfoClient();
const handleClick = () => {
setLoading(true);
sendReq().finally(() => {
setLoading(false);
handleClose();
});
handleClose();
sendReq();
};
const updateData = (name, value) => {
@@ -74,12 +69,11 @@ function Content({
</div>
<div className="w-full flex justify-end">
<Button
disabled={loading}
disabled={!filter?.city || !filter?.state}
className="!w-full md:!w-fit !flex !px-3 items-center justify-center gap-1 mr-auto"
onClick={handleClick}
variant="contained"
color="primary"
disabled={!filter?.city || !filter?.state}
>
تایید و ادامه
<ArrowLeftM />