Phase 5: Positions und Bereiche page with create/staff position modals
This commit is contained in:
@@ -21,9 +21,10 @@ type HireWizardProps = {
|
||||
openPositions: OpenPositionResolved[];
|
||||
locations: { id: string; name: string; country: string }[];
|
||||
resumeDraft: { id: string; step: number; payload: Record<string, unknown> } | null;
|
||||
initialPositionId?: string;
|
||||
};
|
||||
|
||||
export function HireWizard({ open, onClose, openPositions, locations, resumeDraft }: HireWizardProps) {
|
||||
export function HireWizard({ open, onClose, openPositions, locations, resumeDraft, initialPositionId }: HireWizardProps) {
|
||||
const { showToast } = useToast();
|
||||
const router = useRouter();
|
||||
const [step, setStep] = useState(0);
|
||||
@@ -38,11 +39,11 @@ export function HireWizard({ open, onClose, openPositions, locations, resumeDraf
|
||||
setStep(resumeDraft.step);
|
||||
setDraftId(resumeDraft.id);
|
||||
} else {
|
||||
setDraft(EMPTY_HIRE_DRAFT);
|
||||
setDraft({ ...EMPTY_HIRE_DRAFT, positionId: initialPositionId ?? "" });
|
||||
setStep(0);
|
||||
setDraftId(undefined);
|
||||
}
|
||||
}, [open, resumeDraft]);
|
||||
}, [open, resumeDraft, initialPositionId]);
|
||||
|
||||
const selectedPosition = useMemo(
|
||||
() => openPositions.find((p) => p.id === draft.positionId) ?? null,
|
||||
|
||||
Reference in New Issue
Block a user