"use client"; import { Printer } from "lucide-react"; import Link from "next/link"; import { AenderungenImportieren, DatenHerunterladen } from "@/components/austausch/DatenHerunterladen"; import { SegmentedControl } from "@/components/ui/SegmentedControl"; import { useGemerktesWort } from "./ansicht-merken"; import { AsOfPicker } from "./AsOfPicker"; import { EmployeeTree } from "./EmployeeTree"; import { PositionTree } from "./PositionTree"; import type { OrgEmployee, OrgUnitNode, OrgVacancy } from "./types"; type View = "ma" | "pos"; const VIEWS: readonly View[] = ["ma", "pos"] as const; type OrgChartClientProps = { employees: OrgEmployee[]; units: OrgUnitNode[]; vacancies: OrgVacancy[]; asOf: string; today: string; projectedCount: number; historyStartsAt: string | null; /** Arrived via "Im Organigramm anzeigen" — unfold and centre this person. */ focusId: string | null; }; export function OrgChartClient({ employees, units, vacancies, asOf, today, projectedCount, historyStartsAt, focusId, }: OrgChartClientProps) { // Gemerkt, nicht neu gesetzt: wer aus der Organisationssicht eine Person // öffnet, landete sonst beim Zurückgehen wieder auf der Mitarbeitersicht. const [view, setView] = useGemerktesWort("alpenwerk.orgchart.sicht", "ma", VIEWS); return (
value={view} onChange={setView} options={[ { value: "ma", label: "Mitarbeiter" }, { value: "pos", label: "Organisation" }, ]} /> {/* Die Datei enthält alle Einheiten mit ihrer Gültigkeit, nicht den Stand zum gewählten Stichtag: bearbeitet wird der Bestand. */} {/* Der Stichtag wandert mit: wer eine vergangene Struktur ansieht, druckt sie auch. */} Als PDF
{view === "ma" && } {view === "pos" && }
); }