49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
|
|
import {
|
||
|
|
LayoutDashboard,
|
||
|
|
BookOpen,
|
||
|
|
Calendar,
|
||
|
|
Building2,
|
||
|
|
Settings,
|
||
|
|
Shield
|
||
|
|
} from 'lucide-react'
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Shinkan Navigation Configuration
|
||
|
|
* Single source of truth für Bottom-Nav (Mobile) + Desktop-Sidebar
|
||
|
|
*
|
||
|
|
* @typedef {{ to: string, label: string, shortLabel?: string, end?: boolean, Icon: import('react').ForwardRefExoticComponent }} AppNavItem
|
||
|
|
*/
|
||
|
|
|
||
|
|
/** @returns {Omit<AppNavItem, 'Icon'>[]} */
|
||
|
|
function baseItems() {
|
||
|
|
return [
|
||
|
|
{ to: '/', label: 'Übersicht', end: true },
|
||
|
|
{ to: '/exercises', label: 'Übungen', shortLabel: 'Übungen' },
|
||
|
|
{ to: '/planning', label: 'Planung' },
|
||
|
|
{ to: '/clubs', label: 'Vereine' },
|
||
|
|
{ to: '/settings', label: 'Einstellungen', shortLabel: 'Einst.' }
|
||
|
|
]
|
||
|
|
}
|
||
|
|
|
||
|
|
/** @param {boolean} isAdmin */
|
||
|
|
export function getMainNavItems(isAdmin) {
|
||
|
|
const icons = [
|
||
|
|
LayoutDashboard,
|
||
|
|
BookOpen,
|
||
|
|
Calendar,
|
||
|
|
Building2,
|
||
|
|
Settings
|
||
|
|
]
|
||
|
|
|
||
|
|
const raw = baseItems().map((item, i) => ({
|
||
|
|
...item,
|
||
|
|
Icon: icons[i]
|
||
|
|
}))
|
||
|
|
|
||
|
|
if (isAdmin) {
|
||
|
|
raw.push({ to: '/admin', label: 'Admin', end: false, Icon: Shield })
|
||
|
|
}
|
||
|
|
|
||
|
|
return raw
|
||
|
|
}
|