|
@@ -92,6 +92,15 @@ function Layout() {
|
|
|
navigate('/login')
|
|
navigate('/login')
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // Get the base path for menu selection (handles sub-routes like /persons/new)
|
|
|
|
|
+ const getSelectedKey = () => {
|
|
|
|
|
+ const path = location.pathname
|
|
|
|
|
+ const menuKey = menuItems.find(item =>
|
|
|
|
|
+ path === item.key || path.startsWith(item.key + '/')
|
|
|
|
|
+ )?.key
|
|
|
|
|
+ return menuKey ? [menuKey] : [path]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
const toggleDrawer = () => {
|
|
const toggleDrawer = () => {
|
|
|
setDrawerVisible(!drawerVisible)
|
|
setDrawerVisible(!drawerVisible)
|
|
|
}
|
|
}
|