- Removed Admin Panel from SettingsPage and adjusted related logic. - Added EmailSettings component for SMTP configuration and testing. - Created admin navigation structure in adminNav.js for better organization. - Implemented AdminShell layout for consistent admin UI. - Added RequireAdmin component to protect admin routes. - Developed AdminHomePage for admin dashboard with navigation links. - Created AdminSystemPage for SMTP settings and placeholder metadata export. - Implemented AdminUsersPage for user management, including profile creation and editing.
44 lines
1.0 KiB
JavaScript
44 lines
1.0 KiB
JavaScript
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', label: 'Admin', end: false, Icon: Shield })
|
|
}
|
|
return raw
|
|
}
|