import * as React from "react" import { CheckIcon } from "lucide-react" import { cn } from "@/lib/utils" export type StepperStep = { id: string title: React.ReactNode description?: React.ReactNode disabled?: boolean completed?: boolean } export type StepperProps = React.ComponentProps<"div"> & { steps: StepperStep[] currentStep: string onStepChange?: (stepId: string) => void orientation?: "horizontal" | "vertical" } function Stepper({ className, steps, currentStep, onStepChange, orientation = "horizontal", ...props }: StepperProps) { const currentIndex = Math.max(steps.findIndex((step) => step.id === currentStep), 0) return (
{steps.map((step, index) => { const isActive = step.id === currentStep const isComplete = step.completed ?? index < currentIndex const isClickable = Boolean(onStepChange) && !step.disabled return ( ) })}
) } export { Stepper }