import { ReactNode } from "react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; export interface StepConfig { id: string; title: string; description?: string; render: () => ReactNode; } interface StepWizardProps { steps: StepConfig[]; currentIndex: number; onNext: () => void; onBack: () => void; onSubmit: () => void; isSubmitting?: boolean; canGoNext: boolean; } export function StepWizard({ steps, currentIndex, onNext, onBack, onSubmit, isSubmitting, canGoNext, }: StepWizardProps) { const step = steps[currentIndex]; const isLast = currentIndex === steps.length - 1; const progress = ((currentIndex + 1) / steps.length) * 100; return (
{step.title} Step {currentIndex + 1} of {steps.length}
{step.description && (

{step.description}

)} {step.render()}
{!isLast && ( )} {isLast && ( )}
); }