Open History to see the last commit
1import { WizardSteps } from "../ui/wizard";
2import {
3 ADD_PROVIDER_WIZARD_STEPS,
4 resolveWizardNavigation,
5 type WizardNavigation,
6} from "./AddProviderInstanceDialog.logic";
7
8interface AddProviderInstanceWizardStepsProps {
9 readonly currentStep: number;
10 readonly summaries: readonly (string | null)[];
11 readonly instanceIdError: string | null;
12 readonly steps?: readonly string[];
13 readonly identityStep?: number;
14 readonly prerequisite?: {
15 readonly step: number;
16 readonly error: string | null;
17 };
18 readonly onNavigation: (navigation: WizardNavigation) => void;
19}
20
21export function AddProviderInstanceWizardSteps({
22 currentStep,
23 summaries,
24 instanceIdError,
25 steps = ADD_PROVIDER_WIZARD_STEPS,
26 identityStep,
27 prerequisite,
28 onNavigation,
29}: AddProviderInstanceWizardStepsProps) {
30 return (
31 <WizardSteps
32 steps={steps}
33 currentStep={currentStep}
34 summaries={summaries}
35 onStepChange={(requestedStep) =>
36 onNavigation(
37 resolveWizardNavigation(currentStep, requestedStep, steps.length, {
38 instanceIdError,
39 ...(identityStep === undefined ? {} : { identityStep }),
40 ...(prerequisite === undefined ? {} : { prerequisite }),
41 }),
42 )
43 }
44 />
45 );
46}