import { cn } from "@/lib/utils" interface StepIndicatorProps { currentStep: number steps: { id: number; title: string; subtitle: string }[] } export function StepIndicator({ currentStep, steps }: StepIndicatorProps) { return (
{steps.map((step, index) => (
{/* 步骤圆圈 */}
step.id ? "border-green-500 bg-green-500 text-white" : currentStep === step.id ? "border-blue-500 bg-white text-blue-500" : "border-gray-300 bg-white text-gray-300", )} > {currentStep > step.id ? ( ) : ( step.id )}
{/* 步骤标题和描述 */}
= step.id ? "text-blue-500" : "text-gray-400", )} > 步骤 {step.id}
= step.id ? "text-blue-500" : "text-gray-400", )} > {step.subtitle}
{/* 连接线 */} {index < steps.length - 1 && (
step.id ? "bg-green-500" : "bg-gray-300", )} /> )}
))}
) }