import Link from "next/link"; import { Archive, Building2, FileText, LayoutDashboard, ListChecks, LogOut, Menu, ScanLine, Settings, Users, type LucideIcon, } from "lucide-react"; import { Button } from "@/components/ui/button"; import { Bildmarke } from "@/components/bildmarke"; import { Wortmarke } from "@/components/wortmarke"; import type { Rolle } from "@/generated/prisma/enums"; import { navigationFuer, type Betriebsmodus, type NavEintrag } from "@/lib/navigation"; import { ROLLEN_TEXT } from "@/lib/rollen-text"; import { darf } from "@/server/auth/rollen"; import { cn } from "@/lib/utils"; import { versionText } from "@/lib/version"; /** Wird in #014 auf `true` gestellt, zusammen mit der Seite. */ const SCANNEN_VERFUEGBAR = false; const SYMBOLE: Record = { LayoutDashboard, ListChecks, FileText, Users, Building2, Archive, Settings, }; function NavListe({ modus, aktiv, rolle }: { modus: Betriebsmodus; aktiv: string; rolle?: Rolle }) { const eintraege = navigationFuer(modus, (recht) => (rolle ? darf(rolle, recht) : false)); return ( ); } /** Die Uebersicht nur bei genauer Uebereinstimmung, alles andere auch fuer Unterseiten. */ function istAktiv(pfad: string, aktiv: string): boolean { if (pfad === "/") return aktiv === "/"; return aktiv === pfad || aktiv.startsWith(`${pfad}/`); } function NavZeile({ eintrag, aktiv }: { eintrag: NavEintrag; aktiv: boolean }) { const Symbol = SYMBOLE[eintrag.symbol] ?? LayoutDashboard; const inhalt = ( <>