diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index 6e60846..c69d035 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -543,13 +543,22 @@ export function OrderWizard({ addToBasket() } } + setDirection(1) setStep(s => s + 1) } const prevStep = () => { + setDirection(-1) setStep(s => s - 1) } + const goToStep = (targetStep: number) => { + if (targetStep < step) { + setDirection(-1) + setStep(targetStep) + } + } + function handleBillingIntervalChange(val: 'one_time' | 'monthly') { setSelectedBillingInterval(val) if (val === 'monthly') { @@ -866,7 +875,7 @@ export function OrderWizard({ Bestell-Wizard

- + {/* Step 3 Categories inside left sidebar */} {step === 3 && ( diff --git a/shop/components/wizard/progress-stepper.tsx b/shop/components/wizard/progress-stepper.tsx index f571f6c..2bc44e7 100644 --- a/shop/components/wizard/progress-stepper.tsx +++ b/shop/components/wizard/progress-stepper.tsx @@ -7,14 +7,86 @@ 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 }: ProgressStepperProps) { - // Calculate progress percentage for active line (Step 1: 0%, Step 2: 33.3%, Step 3: 66.6%, Step 4: 100%) +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 (