2025-08-22 20:28:50 +01:00

47 lines
1.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useLocation } from 'react-router-dom'
import DashboardSidebar from '../common/DashboardSidebar'
import { Typography } from 'antd'
const { Text } = Typography
const items = [
{
key: 'sessionstorage',
label: 'Session Storage',
icon: <Text>🗃</Text>,
path: '/dashboard/developer/sessionstorage'
},
{
key: 'authcontextdebug',
label: 'Auth Debug',
icon: <Text>🔐</Text>,
path: '/dashboard/developer/authcontextdebug'
},
{
key: 'printservercontextdebug',
label: 'Print Server Debug',
icon: <Text>🖨</Text>,
path: '/dashboard/developer/printservercontextdebug'
}
]
const routeKeyMap = {
'/dashboard/developer/sessionstorage': 'sessionstorage',
'/dashboard/developer/authcontext': 'authcontextdebug',
'/dashboard/developer/printservercontext': 'printservercontextdebug'
}
const DeveloperSidebar = (props) => {
const location = useLocation()
const selectedKey = (() => {
const match = Object.keys(routeKeyMap).find((path) =>
location.pathname.startsWith(path)
)
return match ? routeKeyMap[match] : 'sessionstorage'
})()
return <DashboardSidebar items={items} selectedKey={selectedKey} {...props} />
}
export default DeveloperSidebar