import React from 'react'; import { Check } from 'lucide-react'; interface Step { id: string | number; label: string; description?: string; } interface StepIndicatorProps { steps: Step[]; currentStep: number; /** Color for completed/active steps */ color?: 'blue' | 'brand' | 'green' | 'purple'; /** Show connector lines between steps */ showConnectors?: boolean; /** Additional class name */ className?: string; } const colorClasses = { blue: { active: 'bg-blue-600 text-white', completed: 'bg-blue-600 text-white', pending: 'bg-gray-200 dark:bg-gray-700 text-gray-500', textActive: 'text-blue-600 dark:text-blue-400', textPending: 'text-gray-400', connector: 'bg-blue-600', connectorPending: 'bg-gray-200 dark:bg-gray-700', }, brand: { active: 'bg-brand-600 text-white', completed: 'bg-brand-600 text-white', pending: 'bg-gray-200 dark:bg-gray-700 text-gray-500', textActive: 'text-brand-600 dark:text-brand-400', textPending: 'text-gray-400', connector: 'bg-brand-600', connectorPending: 'bg-gray-200 dark:bg-gray-700', }, green: { active: 'bg-green-600 text-white', completed: 'bg-green-600 text-white', pending: 'bg-gray-200 dark:bg-gray-700 text-gray-500', textActive: 'text-green-600 dark:text-green-400', textPending: 'text-gray-400', connector: 'bg-green-600', connectorPending: 'bg-gray-200 dark:bg-gray-700', }, purple: { active: 'bg-purple-600 text-white', completed: 'bg-purple-600 text-white', pending: 'bg-gray-200 dark:bg-gray-700 text-gray-500', textActive: 'text-purple-600 dark:text-purple-400', textPending: 'text-gray-400', connector: 'bg-purple-600', connectorPending: 'bg-gray-200 dark:bg-gray-700', }, }; export const StepIndicator: React.FC = ({ steps, currentStep, color = 'blue', showConnectors = true, className = '', }) => { const colors = colorClasses[color]; return (
{steps.map((step, index) => { const stepNumber = index + 1; const isCompleted = stepNumber < currentStep; const isActive = stepNumber === currentStep; const isPending = stepNumber > currentStep; return (
{/* Step circle */}
{isCompleted ? : stepNumber}
{/* Step label */} {step.label}
{/* Connector */} {showConnectors && index < steps.length - 1 && (
)} ); })}
); }; export default StepIndicator;