import { fmtDate } from "@/lib/format"; import type { Database } from "@/lib/supabase/types"; type EmployeeRow = Database["public"]["Tables"]["employees"]["Row"]; const PAYGRADE_LABELS: Record = { A: "A – Einstieg", B: "B – Qualifiziert", C: "C – Erfahren", D: "D – Spezialist:in", E: "E – Teamleitung", F: "F – Bereichsleitung / GF", }; export function VertragTab({ employee }: { employee: EmployeeRow }) { const rows: [string, string][] = [ ["Eintrittsdatum", fmtDate(employee.entry_date)], ["Vertragsart", employee.contract_type === "befristet" ? `befristet bis ${fmtDate(employee.contract_end_date)}` : "unbefristet"], ["Kollektivvertrag", "Metalltechnische Industrie"], ["Beschäftigungsausmaß", employee.employment_type], ["Wochenstunden", `${employee.weekly_hours} h`], ["Urlaubsanspruch", "25 Tage"], ["Paygrade", PAYGRADE_LABELS[employee.paygrade] ?? employee.paygrade], ]; if (employee.exit_date) rows.push(["Austrittsdatum", fmtDate(employee.exit_date)]); return (
{rows.map(([label, value]) => (
{label}
{value}
))}
); }