"use client"; import { useState } from "react"; import { SegmentedControl } from "@/components/ui/SegmentedControl"; import type { OpenPositionResolved } from "@/lib/positions"; import { EmployeeTree } from "./EmployeeTree"; import { PositionTree } from "./PositionTree"; import { ReorgWorkbench } from "./ReorgWorkbench"; import type { OrgDepartment, OrgDivision, OrgEmployee, OrgTeam, ReorgScenarioSummary } from "./types"; type View = "ma" | "pos" | "reo"; type OrgChartClientProps = { employees: OrgEmployee[]; divisions: OrgDivision[]; departments: OrgDepartment[]; teams: OrgTeam[]; openPositions: OpenPositionResolved[]; reorgScenarios: ReorgScenarioSummary[]; }; export function OrgChartClient({ employees, divisions, departments, teams, openPositions, reorgScenarios }: OrgChartClientProps) { const [view, setView] = useState("ma"); return (
value={view} onChange={setView} options={[ { value: "ma", label: "Mitarbeiter" }, { value: "pos", label: "Positionen" }, { value: "reo", label: "Reorganisation" }, ]} /> {view === "ma" && } {view === "pos" && ( )} {view === "reo" && ( )}
); }