// Phase 4 closure (FE-M3): OnboardingWizard mega-page split. // // Pre-Phase-4 this file was 1043 LOC containing: // • 4 step component definitions (Issuer / Agent / Certificate / Complete) // • 2 inline modal helpers (CreateTeamModalInline, CreateOwnerModalInline) // • 3 layout helpers (CodeBlock, StepIndicator, WizardFooter) // • The shell + state + step transitions // — all in a single file that took ~30s to navigate end-to-end in the // editor and hit the eslint per-file-LOC ceiling. // // Post-Phase-4 this file is just the shell + state + step transitions // (~67 LOC). Each step now lives in src/pages/onboarding/ as its own // file, importable in isolation: // // • types.ts — WizardStep type + STEPS list // • StepShell.tsx — shared CodeBlock + StepIndicator + WizardFooter // • IssuerStep.tsx — Step 1 // • AgentStep.tsx — Step 2 // • CertificateStep.tsx — Step 3 (owns its inline team/owner modals) // • CompleteStep.tsx — Step 4 // // Behavior preserved byte-equivalent — no logic change, just a // directory reshape. DashboardPage's lazy(() => import('./OnboardingWizard')) // import path is unchanged because this file still exists at the same // location and still has a default export with the same prop shape. import { useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { STEPS, type WizardStep } from './onboarding/types'; import { StepIndicator } from './onboarding/StepShell'; import IssuerStep from './onboarding/IssuerStep'; import AgentStep from './onboarding/AgentStep'; import CertificateStep from './onboarding/CertificateStep'; import CompleteStep from './onboarding/CompleteStep'; export default function OnboardingWizard({ onDismiss }: { onDismiss: () => void }) { const [step, setStep] = useState('issuer'); const [createdIssuerId, setCreatedIssuerId] = useState(null); const [issuerName, setIssuerName] = useState(null); const [certName, setCertName] = useState(null); const navigate = useNavigate(); const goTo = (s: WizardStep) => setStep(s); return ( <>

Welcome to certctl

Let's set up your certificate lifecycle management

{step === 'issuer' && ( goTo('agent')} onSkip={() => goTo('agent')} onIssuerCreated={(iss) => { setCreatedIssuerId(iss.id); setIssuerName(iss.name); }} /> )} {step === 'agent' && ( goTo('certificate')} onSkip={() => goTo('certificate')} /> )} {step === 'certificate' && ( { if (name) setCertName(name); goTo('complete'); }} onSkip={() => goTo('complete')} createdIssuerId={createdIssuerId} /> )} {step === 'complete' && ( { onDismiss(); navigate('/'); }} issuerName={issuerName} certName={certName} /> )}
); }