diff --git a/components/wizard/step-indicator.tsx b/components/wizard/step-indicator.tsx new file mode 100644 index 0000000..1aba357 --- /dev/null +++ b/components/wizard/step-indicator.tsx @@ -0,0 +1,152 @@ +"use client" + +import { motion } from "motion/react" +import { Check, Info } from "lucide-react" +import { useState } from "react" + +interface Step { + label: string + tooltip: string +} + +interface StepIndicatorProps { + steps: Step[] + currentStep: number + onStepClick?: (step: number) => void +} + +export function StepIndicator({ + steps, + currentStep, + onStepClick, +}: StepIndicatorProps) { + const [showTooltip, setShowTooltip] = useState(null) + + return ( +
+ {/* Desktop: horizontal steps */} +
+ {steps.map((step, index) => { + const isCompleted = index < currentStep + const isCurrent = index === currentStep + const isClickable = index <= currentStep + + return ( +
+ {/* Step circle with tooltip */} +
+ + + {/* Tooltip */} + {showTooltip === index && ( + +

+ {step.label} +

+

{step.tooltip}

+
+ )} +
+ + {/* Step label */} + + {step.label} + + + {/* Connector line */} + {index < steps.length - 1 && ( +
+
+ +
+
+ )} +
+ ) + })} +
+ + {/* Mobile: compact step indicator */} +
+ + Step {currentStep + 1} of {steps.length} + +
+ + {showTooltip === currentStep && ( + +

+ {steps[currentStep].label} +

+

+ {steps[currentStep].tooltip} +

+
+ )} +
+
+ + {/* Mobile: step dots */} +
+ {steps.map((_, index) => ( +
+
+ ) +}