This commit is contained in:
seb
2026-07-31 19:38:52 +02:00
parent d08cf7f2df
commit 7cd053ada6
9 changed files with 221 additions and 117 deletions

View File

@@ -10,6 +10,7 @@ import ListAltIcon from '@mui/icons-material/ListAlt';
import ArchiveIcon from '@mui/icons-material/Archive';
import GroupsIcon from '@mui/icons-material/Groups';
import ContactPageIcon from '@mui/icons-material/ContactPage';
import { isKategorienPath } from './pages/artikel/categoryRoute';
export const NAV_ITEMS = [
{ path: '/artikel', label: 'Artikel', icon: Inventory2Icon },
@@ -19,6 +20,15 @@ export const NAV_ITEMS = [
{ path: '/infos', label: 'Infos', icon: InfoIcon },
];
export function isNavItemActive(pathname, navPath) {
if (navPath === '/artikel') {
return pathname === navPath
|| pathname.startsWith(`${navPath}/`)
|| isKategorienPath(pathname);
}
return pathname === navPath || pathname.startsWith(`${navPath}/`);
}
export const SUB_NAV = {
'/artikel': [
{ segment: '', icon: ViewListIcon },