This commit is contained in:
a.ilin
2026-10-05 22:51:10 +03:00
parent 5995008c22
commit cfca0e1e71
8 changed files with 260 additions and 10 deletions
+3 -1
View File
@@ -7,7 +7,7 @@ import {
UserOutlined,
} from '@ant-design/icons'
import { Avatar, Button, Layout, Menu, Result, Space, Tag, Typography } from 'antd'
import { Outlet, useLocation } from 'react-router-dom'
import { Outlet, useLocation, useNavigate } from 'react-router-dom'
import { ROLE_MANAGE_AREA, ROLE_MANAGE_ATTRACTION } from '@/auth/roles'
import { useAuth } from '@/auth/AuthContext'
@@ -21,6 +21,7 @@ const ROLE_LABELS: Record<string, string> = {
export function AdminLayout() {
const { email, roles, logout } = useAuth()
const location = useLocation()
const navigate = useNavigate()
const hasManageArea = roles.includes(ROLE_MANAGE_AREA)
const hasManageAttraction = roles.includes(ROLE_MANAGE_ATTRACTION)
@@ -102,6 +103,7 @@ export function AdminLayout() {
mode="inline"
selectedKeys={[selectedKey]}
items={menuItems}
onClick={({ key }) => navigate(key)}
style={{ height: '100%', borderRight: 0, paddingTop: 8 }}
/>
</Sider>