"use client"; import { Check } from "lucide-react"; import { WizardStep } from "../../hooks/useSubscriptionWizard"; type WizardProgressIndicatorProps = { currentStep: WizardStep; }; const STEPS: { key: WizardStep; label: string }[] = [ { key: "plan-selection", label: "Select Plan" }, { key: "review", label: "Review" }, { key: "payment-method", label: "Payment" }, ]; function getStepIndex(step: WizardStep): number { return STEPS.findIndex((s) => s.key === step); } export function WizardProgressIndicator({ currentStep }: WizardProgressIndicatorProps) { const currentIndex = getStepIndex(currentStep); return (
{STEPS.map((step, index) => { const isCompleted = index < currentIndex; const isCurrent = index === currentIndex; return (
{/* Step Indicator */}
{isCompleted ? : index + 1}
{/* Step Label */} {step.label} {/* Connector */} {index < STEPS.length - 1 && (
)}
); })}
); }