import {useState} from "react"; import {Grid, Layout, Menu} from "antd"; import {Outlet, useLocation, useNavigate} from "react-router-dom"; import { HomeOutlined, CalendarOutlined, DatabaseOutlined, FolderViewOutlined, UserOutlined, TeamOutlined, LogoutOutlined, MessageOutlined } from "@ant-design/icons"; import {useAuth} from "../../Hooks/AuthContext.jsx"; const {Content, Footer, Sider} = Layout; const getItem = (label, key, icon, children) => ({key, icon, children, label}); const {useBreakpoint} = Grid; const MainLayout = () => { const screens = useBreakpoint(); const [collapsed, setCollapsed] = useState(true); const navigate = useNavigate(); const location = useLocation(); const {logout} = useAuth(); const menuItems = [ getItem("Главная", "/", ), getItem("Приёмы", "/appointments", ), getItem("Выдачи линз", "/issues", ), getItem("Линзы и наборы", "/Lenses", ), getItem("Пациенты", "/Patients", ), getItem("Рассылки", "/mailing", ), {type: "divider"}, getItem("Мой профиль", "profile", , [ getItem("Перейти в профиль", "/profile", ), getItem("Выйти", "logout", ) ]) ]; const handleMenuClick = ({key}) => { if (key === "logout") { logout(); return; } navigate(key); }; return (
Логотип
); }; export default MainLayout;