feat: Implement responsive desktop sidebar navigation and update app structure
This commit is contained in:
1 parent
922c846b03
commit
7e8422cbd7
5 files changed
+397
-52
No files matched your search
@@ -0,0 +1,43 @@
|
||||
import {
|
||||
LayoutDashboard,
|
||||
PlusSquare,
|
||||
TrendingUp,
|
||||
BarChart2,
|
||||
Settings,
|
||||
Shield
|
||||
} from 'lucide-react'
|
||||
|
||||
/**
|
||||
* Eine Quelle für Hauptnavigation (Bottom-Nav + 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: '/capture', label: 'Erfassen' },
|
||||
{ to: '/history', label: 'Verlauf' },
|
||||
{ to: '/analysis', label: 'Analyse' },
|
||||
{ to: '/settings', label: 'Einstellungen', shortLabel: 'Einst.' }
|
||||
]
|
||||
}
|
||||
|
||||
/** @param {boolean} isAdmin */
|
||||
export function getMainNavItems(isAdmin) {
|
||||
const icons = [
|
||||
LayoutDashboard,
|
||||
PlusSquare,
|
||||
TrendingUp,
|
||||
BarChart2,
|
||||
Settings
|
||||
]
|
||||
const raw = baseItems().map((item, i) => ({
|
||||
...item,
|
||||
Icon: icons[i]
|
||||
}))
|
||||
if (isAdmin) {
|
||||
raw.push({ to: '/admin/features', label: 'Admin', Icon: Shield })
|
||||
}
|
||||
return raw
|
||||
}
|
||||
Reference in new issue
Block a user