refactor: remove unused components and files related to date filtering and doctor search
- Deleted Date.js and FilterDate.js components as they are no longer needed. - Removed SearchDoctor.js component which was responsible for searching doctors. - Cleaned up the Head component by removing references to the deleted Date and SearchDoctor components. - Removed TurnsPage component and its associated List component, which were not utilized. - Deleted Cards and Table components from the list directory as they were not in use. - Removed user account related components including Tab, Head, and Form components. - Cleaned up bank account components including List, Item, and modal components. - Removed representation adapters and related functions that were not in use.
This commit is contained in:
@@ -1,34 +1,18 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useState } from "react";
|
||||
import ProfilePA from "@/components/icons/ProfilePA";
|
||||
import LogoutP from "@/components/icons/LogoutP";
|
||||
import CardDA from "@/components/icons/CardDA";
|
||||
import { Button, Popover } from "@mui/material";
|
||||
import Link from "next/link";
|
||||
import ModalLogout from "./ModalLogout";
|
||||
import Cookies from "js-cookie";
|
||||
|
||||
function DetailProfile({ anchorEl, setAnchorEl }) {
|
||||
const [modal, setModal] = useState(false);
|
||||
const [hasRepresentationRole, setHasRepresentationRole] = useState(false);
|
||||
|
||||
const handleClose = () => setAnchorEl(null);
|
||||
const closeModal = () => setModal(false);
|
||||
const openModal = () => setModal(true);
|
||||
|
||||
useEffect(() => {
|
||||
const userInfo = Cookies.get("userInfo");
|
||||
if (userInfo) {
|
||||
try {
|
||||
const parsedUserInfo = JSON.parse(userInfo);
|
||||
const roles = parsedUserInfo?.roles || {};
|
||||
const hasRole = Object.values(roles).includes("representation");
|
||||
setHasRepresentationRole(hasRole);
|
||||
} catch (error) {
|
||||
console.error("Error parsing userInfo:", error);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
const open = Boolean(anchorEl);
|
||||
const id = open ? "simple-popover" : undefined;
|
||||
|
||||
@@ -74,18 +58,6 @@ function DetailProfile({ anchorEl, setAnchorEl }) {
|
||||
تراکنش های من
|
||||
</Button>
|
||||
</Link>
|
||||
{hasRepresentationRole && (
|
||||
<Link href="/panel/dashboard" className="w-full">
|
||||
<Button
|
||||
fullWidth
|
||||
variant="text"
|
||||
className="!text-[#7E7E7E] !text-[14px] !font-medium !flex !justify-start !p-[8px] !gap-[5px]"
|
||||
>
|
||||
<ProfilePA />
|
||||
داشبورد نماینده
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
<Button
|
||||
fullWidth
|
||||
color="error"
|
||||
|
||||
Reference in New Issue
Block a user