- Import ReviewStep in App.tsx and add as steps[3] - Update STEP_LABELS in StepIndicator.tsx to include 'Review' as fourth entry - Update comment: 1.Backend > 2.Remote Config > 3.Deployment > 4.Review - Full npm test suite (98 tests, 12 files) remains GREEN
48 lines
1.6 KiB
TypeScript
48 lines
1.6 KiB
TypeScript
// src/App.tsx
|
|
// Step router — renders the correct step component based on currentStep.
|
|
// StepIndicator renders above each step as persistent breadcrumb navigation.
|
|
|
|
import { useWizard } from './store/context';
|
|
import { WizardProvider } from './store/context';
|
|
import { StepIndicator } from './components/wizard/StepIndicator';
|
|
import { BackendSelectionStep } from './components/wizard/BackendSelectionStep';
|
|
import { RemoteConfigStep } from './components/wizard/RemoteConfigStep';
|
|
import { DeploymentStep } from './components/wizard/DeploymentStep';
|
|
import { ReviewStep } from './components/wizard/ReviewStep';
|
|
|
|
function WizardShell() {
|
|
const { state } = useWizard();
|
|
|
|
const steps = [
|
|
<BackendSelectionStep key="backend" />,
|
|
// Key on backendType to force remount when backend changes — prevents stale form values
|
|
<RemoteConfigStep key={state.remote.backendType ?? 'none'} />,
|
|
<DeploymentStep key="deployment" />,
|
|
<ReviewStep key="review" />,
|
|
];
|
|
|
|
// Guard: clamp to valid range
|
|
const stepIndex = Math.min(state.currentStep, steps.length - 1);
|
|
const CurrentStep = steps[stepIndex];
|
|
|
|
return (
|
|
<div className="min-h-screen bg-gray-50 flex flex-col items-center py-12 px-4">
|
|
<div className="w-full max-w-2xl">
|
|
<h1 className="text-3xl font-bold text-gray-900 mb-8 text-center">Ready2Blob</h1>
|
|
<StepIndicator />
|
|
<div className="mt-8">
|
|
{CurrentStep}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default function App() {
|
|
return (
|
|
<WizardProvider>
|
|
<WizardShell />
|
|
</WizardProvider>
|
|
);
|
|
}
|