"use client"; import { LogOut } from "lucide-react"; import { usePathname } from "next/navigation"; import { logout } from "@/actions/auth"; import { NewHireButton } from "./NewHireButton"; const TITLES: Record = { "/": "Übersicht", "/employees": "Mitarbeiter:innen", "/orgchart": "Organigramm", "/positions": "Positionen & Bereiche", "/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; }; export function Topbar({ userLabel }: TopbarProps) { const pathname = usePathname(); return (

{titleFor(pathname)}

{userLabel}
); }