import React from 'react'; import { Icon, type IconName } from '../ui/Icon'; import { Avatar } from '../ui/controls'; import { PulseMark } from './PulseMark'; import { useAuth } from '../../lib/auth'; import { ROLE_LABELS, VIEW_LABELS, homeFor, viewsFor, type ViewKey } from '../../types'; export const VIEW_ICONS: Record = { dashboard: 'dashboard', buchung: 'clock', projekte: 'folder', team: 'team', kunden: 'building', reports: 'chart', einstellungen: 'settings', }; interface SidebarProps { current: ViewKey; onNavigate: (view: ViewKey) => void; collapsed: boolean; onAccount: () => void; } /** Seitenleiste fuer Desktop/Tablet. Auf dem Handy uebernimmt die MobileNav. */ export const Sidebar: React.FC = ({ current, onNavigate, collapsed, onAccount }) => { const { user, logout } = useAuth(); if (!user) return null; const views = viewsFor(user.role); const main = views.filter((v) => v !== 'einstellungen'); const home = homeFor(user.role); const item = (view: ViewKey) => { const active = current === view; return ( ); }; return ( ); };