'use client' import React from 'react' import { motion } from 'framer-motion' import { Check } from 'lucide-react' interface ProgressStepperProps { step: number basketItemsCount: number orientation?: 'horizontal' | 'vertical' onStepClick?: (step: number) => void } const STEP_LABELS = ['Kunde', 'Modell', 'Software', 'Abschluss'] export function ProgressStepper({ step, basketItemsCount, orientation = 'horizontal', onStepClick }: ProgressStepperProps) { const progressPercent = ((step - 1) / 3) * 100 if (orientation === 'vertical') { return (
{/* Static Background Vertical Line */}
{/* Animated Active Vertical Line */} {[1, 2, 3, 4].map(s => { const isDone = step > s const isActive = step === s const isClickable = onStepClick && s < step return (
isClickable && onStepClick(s)} className={`relative z-10 flex items-center gap-3 ${isClickable ? 'cursor-pointer group' : ''}`} > {isDone ? : s}
{STEP_LABELS[s - 1]} {s === 3 && basketItemsCount > 0 && ( {basketItemsCount} )} {isClickable && ( Zurück zu Schritt {s} )}
) })}
) } // Calculate progress percentage for active line (Step 1: 0%, Step 2: 33.3%, Step 3: 66.6%, Step 4: 100%) return (
{/* Static Background Line */}
{/* Animated Active Line (bg-sky-500) */} {[1, 2, 3, 4].map(s => { const isDone = step > s const isActive = step === s return (
{isDone ? : s} {STEP_LABELS[s - 1]} {s === 3 && basketItemsCount > 0 && ( {basketItemsCount} )}
) })}
) }