import { Network } from "lucide-react"; import Link from "next/link"; import { Avatar } from "@/components/ui/Avatar"; import { LINK_BUTTON_CLASS } from "@/components/ui/Button"; import { fmtName } from "@/lib/format"; type MiniEmployee = { id: string; first_name: string; last_name: string; job_title: string; status?: string }; type OrganisationTabProps = { employeeId: string; manager: MiniEmployee | null; /** Nur gesetzt, wenn die zuständige Leitung abwesend ist und vertreten wird. */ formalManager: MiniEmployee | null; directReports: MiniEmployee[]; breadcrumb: string; }; export function OrganisationTab({ employeeId, manager, formalManager, directReports, breadcrumb }: OrganisationTabProps) { return (

Organisationseinheit

{breadcrumb}

{/* ?focus= drives the same highlight/auto-expand path the org chart search already uses, so the person is unfolded and centred on arrival instead of the user hunting for them. */} Im Organigramm anzeigen

{formalManager ? "Führungskraft (Vertretung)" : "Führungskraft"}

{formalManager && (

Zuständig ist {fmtName(formalManager.first_name, formalManager.last_name)}; während der Abwesenheit übernimmt die nächste besetzte Ebene.

)} {manager ? (
{fmtName(manager.first_name, manager.last_name)}
{manager.job_title}
) : (

Keine Führungskraft (Geschäftsführung)

)}

Direkte Berichte ({directReports.length})

{directReports.length > 0 ? (
{directReports.map((r) => (
{fmtName(r.first_name, r.last_name)}
{r.job_title}
))}
) : (

Keine direkten Berichte.

)}
); }