48 lines
1.9 KiB
JavaScript
48 lines
1.9 KiB
JavaScript
import Inventory2Icon from '@mui/icons-material/Inventory2';
|
|
import LocalShippingIcon from '@mui/icons-material/LocalShipping';
|
|
import AssignmentIcon from '@mui/icons-material/Assignment';
|
|
import PeopleIcon from '@mui/icons-material/People';
|
|
import InfoIcon from '@mui/icons-material/Info';
|
|
import ViewListIcon from '@mui/icons-material/ViewList';
|
|
import CategoryIcon from '@mui/icons-material/Category';
|
|
import WarehouseIcon from '@mui/icons-material/Warehouse';
|
|
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 },
|
|
{ path: '/lieferung', label: 'Lieferung', icon: LocalShippingIcon },
|
|
{ path: '/auftrag', label: 'Auftrag', icon: AssignmentIcon },
|
|
{ path: '/kunde', label: 'Kunde', icon: PeopleIcon },
|
|
{ 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 },
|
|
{ segment: 'kategorien', label: 'Kategorien', icon: CategoryIcon },
|
|
{ segment: 'lager', label: 'Lager', icon: WarehouseIcon },
|
|
],
|
|
'/auftrag': [
|
|
{ segment: '', label: 'Aktive Aufträge', icon: ListAltIcon },
|
|
{ segment: 'archiv', label: 'Archiv', icon: ArchiveIcon },
|
|
],
|
|
'/kunde': [
|
|
{ segment: '', label: 'Kundenliste', icon: PeopleIcon },
|
|
{ segment: 'gruppen', label: 'Gruppen', icon: GroupsIcon },
|
|
{ segment: 'kontakte', label: 'Kontakte', icon: ContactPageIcon },
|
|
],
|
|
};
|