"use client"; import { LogOut, Menu } from "lucide-react"; import { usePathname } from "next/navigation"; import { logout } from "@/actions/auth"; import type { OpenNote } from "@/lib/notes"; import { NewHireButton } from "./NewHireButton"; import { NotesBell } from "./NotesBell"; const TITLES: Record = { "/": "Übersicht", "/employees": "Mitarbeiter:innen", "/orgchart": "Organigramm", "/positions": "Positionen", "/reports": "Berichte", "/audit": "Audit-Log", }; function titleFor(pathname: string): string { if (TITLES[pathname]) return TITLES[pathname]; const match = Object.keys(TITLES).find((key) => key !== "/" && pathname.startsWith(key)); return match ? TITLES[match] : "Alpenwerk HR"; } type TopbarProps = { userLabel: string; openNotes: OpenNote[]; onOpenNav: () => void; }; export function Topbar({ userLabel, openNotes, onOpenNav }: TopbarProps) { const pathname = usePathname(); return ( // Sticky, with the notch inset added to its top padding: on an iPhone in // landscape the bar would otherwise sit under the rounded corner.

{titleFor(pathname)}

{/* The name is the first thing worth dropping on a narrow screen — the account is still reachable via the sign-out control. */} {userLabel}
); }