Session 6.3
This commit is contained in:
31
src/components/onboarding/onboarding-flow.tsx
Normal file
31
src/components/onboarding/onboarding-flow.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { OnboardingWizard } from "./wizard";
|
||||
import { ProvisioningStatus } from "./provisioning-status";
|
||||
|
||||
interface OnboardingFlowProps {
|
||||
orgName: string;
|
||||
initialState: "no_request" | "pending" | "approved" | "provisioning" | "rejected";
|
||||
}
|
||||
|
||||
/**
|
||||
* Orchestrates the onboarding experience:
|
||||
* - no_request → show wizard
|
||||
* - pending/approved/provisioning/rejected → show status
|
||||
* - After wizard submission → switch to status polling
|
||||
*/
|
||||
export function OnboardingFlow({ orgName, initialState }: OnboardingFlowProps) {
|
||||
const [showWizard, setShowWizard] = useState(initialState === "no_request");
|
||||
|
||||
if (showWizard) {
|
||||
return (
|
||||
<OnboardingWizard
|
||||
orgName={orgName}
|
||||
onComplete={() => setShowWizard(false)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
return <ProvisioningStatus />;
|
||||
}
|
||||
Reference in New Issue
Block a user