import { SvNummerField } from "@/components/employees/SvNummerField"; import { TitleFields } from "@/components/employees/TitleFields"; import { SelectField, TextField } from "@/components/ui/Field"; import type { HireDraftData } from "./types"; type StepPersonProps = { draft: HireDraftData; update: (patch: Partial) => void; locations: { id: string; name: string; country: string }[]; }; export function StepPerson({ draft, update, locations }: StepPersonProps) { return (
update({ personnelNumber: personnelNumber.replace(/\D/g, "") })} hint="Muss mit Loga und Interflex übereinstimmen. Wird nicht automatisch vergeben." />
update({ firstName })} /> update({ lastName })} />
update({ gender: gender as HireDraftData["gender"] })} options={[ { value: "m", label: "männlich" }, { value: "w", label: "weiblich" }, ]} /> update({ birthDate })} />
update({ svNummer })} locationCountry={locations.find((l) => l.id === draft.locationId)?.country} birthDate={draft.birthDate || null} />
update({ email })} /> update({ phone })} />
{/* Daten einer dritten Person — nur für den Notfall erhoben. Name und Nummer gehören zusammen: eines allein nützt im Ernstfall nichts, und die Datenbank weist es ab. */}
Notfallkontakt
update({ emergencyContactName })} /> update({ emergencyContactPhone })} />
update({ emergencyContactRelation })} hint="Zum Beispiel Gattin, Bruder, Freundin. Freitext — die Aufzählung liesse sich nicht schliessen." />
update({ locationId })} placeholder="Bitte wählen…" options={locations.map((l) => ({ value: l.id, label: `${l.name} (${l.country})` }))} />
); }