import { fmtAge, fmtDate } from "@/lib/format"; import type { Database } from "@/lib/supabase/types"; type EmployeeRow = Database["public"]["Tables"]["employees"]["Row"]; type Location = Database["public"]["Tables"]["locations"]["Row"]; export function StammdatenTab({ employee, location }: { employee: EmployeeRow; location?: Location }) { const rows: [string, string][] = [ ["Geburtsdatum", `${fmtDate(employee.birth_date)} (${fmtAge(employee.birth_date)} Jahre)`], ["SV-Nummer", employee.sv_nummer ?? "–"], ["Staatsbürgerschaft", employee.nationality], ["E-Mail", employee.email], ["Telefon", employee.phone ?? "–"], ["Standort", location ? `${location.name} (${location.country})` : "–"], ["Adresse", employee.address ?? "–"], ["Geschlecht", employee.gender === "m" ? "männlich" : "weiblich"], ]; return (
{rows.map(([label, value]) => (
{label}
{value}
))}
); }