import { SvNummerField } from "@/components/employees/SvNummerField"; import { TitleFields } from "@/components/employees/TitleFields"; import { SelectField, TextField } from "@/components/ui/Field"; import { PersonalnummerField } from "./PersonalnummerField"; import type { HireDraftData } from "./types"; type StepPersonProps = { draft: HireDraftData; update: (patch: Partial) => void; locations: { id: string; name: string; country: string }[]; /** Meldet die geprüfte Personalnummer und ihr Ergebnis — steuert „Weiter". */ onNummerBefund: (befund: { nummer: number; vergeben: boolean }) => void; }; export function StepPerson({ draft, update, locations, onNummerBefund }: StepPersonProps) { return (
update({ personnelNumber })} onBefund={onNummerBefund} />
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} />
{/* Die private Adresse, nicht die Firmenadresse — die entsteht erst mit dem Eintritt. Freiwillig: wer keine hat oder keine angeben will, soll nicht gezwungen sein, eine zu erfinden. */} update({ email })} /> update({ phone })} />
update({ locationId })} placeholder="Bitte wählen…" options={locations.map((l) => ({ value: l.id, label: `${l.name} (${l.country})` }))} />
); }