Phase 5: Positions und Bereiche page with create/staff position modals
This commit is contained in:
@@ -7,8 +7,10 @@ import { HireWizard } from "./HireWizard";
|
||||
type Location = { id: string; name: string; country: string };
|
||||
type HireDraft = { id: string; step: number; payload: Record<string, unknown> };
|
||||
|
||||
type OpenWizardOptions = { draftId?: string; positionId?: string };
|
||||
|
||||
type HireWizardContextValue = {
|
||||
openWizard: (draftId?: string) => void;
|
||||
openWizard: (options?: OpenWizardOptions) => void;
|
||||
};
|
||||
|
||||
const HireWizardContext = createContext<HireWizardContextValue | null>(null);
|
||||
@@ -26,9 +28,11 @@ export function HireWizardProvider({
|
||||
}) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [resumeDraft, setResumeDraft] = useState<HireDraft | null>(null);
|
||||
const [initialPositionId, setInitialPositionId] = useState<string | undefined>(undefined);
|
||||
|
||||
function openWizard(draftId?: string) {
|
||||
setResumeDraft(draftId ? (drafts.find((d) => d.id === draftId) ?? null) : null);
|
||||
function openWizard(options?: OpenWizardOptions) {
|
||||
setResumeDraft(options?.draftId ? (drafts.find((d) => d.id === options.draftId) ?? null) : null);
|
||||
setInitialPositionId(options?.positionId);
|
||||
setOpen(true);
|
||||
}
|
||||
|
||||
@@ -41,6 +45,7 @@ export function HireWizardProvider({
|
||||
openPositions={openPositions}
|
||||
locations={locations}
|
||||
resumeDraft={resumeDraft}
|
||||
initialPositionId={initialPositionId}
|
||||
/>
|
||||
</HireWizardContext.Provider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user