diff --git a/shop/components/order-wizard.tsx b/shop/components/order-wizard.tsx index f65f1ce..1e18c3f 100644 --- a/shop/components/order-wizard.tsx +++ b/shop/components/order-wizard.tsx @@ -168,6 +168,7 @@ export function OrderWizard({ const [editingIdx, setEditingIdx] = useState(null) const [orderNotes, setOrderNotes] = useState('') const [toast, setToast] = useState<{ message: string; type: 'error' | 'success' } | null>(null) + const [activeCategoryId, setActiveCategoryId] = useState(null) useEffect(() => { if (toast) { @@ -235,6 +236,12 @@ export function OrderWizard({ }) }, [categories, selectedBillingInterval]) + useEffect(() => { + if (visibleCategories.length > 0 && !visibleCategories.some(c => c.id === activeCategoryId)) { + setActiveCategoryId(visibleCategories[0].id) + } + }, [visibleCategories, activeCategoryId]) + // Endkunden Filterung const filteredEndCustomers = useMemo(() => { const term = searchTerm.toLowerCase().trim() @@ -843,8 +850,6 @@ export function OrderWizard({ nextStep={nextStep} /> - )} - {/* Step 3: Software Selector */} {step === 3 && ( -
+
- {/* FAR LEFT: License Lookup Panel (sticky) */} -
- -
- - {/* CENTER: Sticky stepper + scrollable categories */} -
- {/* Sticky stepper header — only covers center column */} -
-

Schritt 3 von 4 — Software konfigurieren

- + {/* LEFT: Categories Sidebar Menu */} +
+
+

+ Software konfigurieren +

+

+ Klicken Sie sich durch die Kategorien und wählen Sie Ihre Lizenzen. +

- {/* Scrollable category content area */} +
+ {visibleCategories.map((cat) => { + const sel = selections[cat.id] + const hasSelection = sel?.productIds?.length > 0 || !!sel?.productId + const isRequired = cat.is_required + const isActive = activeCategoryId === cat.id + + return ( + + ) + })} +
+
+ + {/* CENTER: Scrollable Category Selection */} +
{/* Upgrade-Modus Hinweis-Banner */} {upgradeMode && lockedDeviceId && ( @@ -895,46 +953,59 @@ export function OrderWizard({ billingLabel={billingLabel} billingBadgeClass={billingBadgeClass} existingModuleIds={existingModuleIds} + activeCategoryId={activeCategoryId} />
- {/* RIGHT: Summary sidebar (sticky) */} -
- + {/* RIGHT: Stepper Header + Summary sidebar */} +
+ {/* Steps indicator at the top right */} +
+

Schritt 3 von 4 — Software konfigurieren

+ +
+ +
+ +
)} + + + + {/* Step 4: Verification & Submit */} {step === 4 && ( -
-
-
- +
+
+
+
+ +
+

Einmaliger Kauf

-

Einmaliger Kauf

+

+ Einmalige Anschaffungskosten für die Softwarelizenz. Keine monatlichen Mietgebühren. +

-

- Einmalige Anschaffungskosten für die Softwarelizenz. Keine monatlichen Mietgebühren. -

+ + {selectedBillingInterval === 'one_time' && ( +
+ +
+ )} + + {selectedBillingInterval === 'one_time' && customerMode === 'select' && selectedEndCustomerId && ( +
e.stopPropagation()} + className="mt-4 pt-4 border-t border-white/5 space-y-2 cursor-default" + > + + setLastLicenseDate(e.target.value)} + className="bg-[#0b1329] border-white/10 text-white text-xs h-8 focus:border-primary" + /> +

+ Ermöglicht automatische Ermittlung von Update-Gebühren. +

+
+ )}
- {selectedBillingInterval === 'one_time' && ( -
- -
- )}
{/* Option 2: Abo */} @@ -92,26 +117,6 @@ export function StepBilling({
)}
-
- {/* Alte Lizenznummereingabe / Datum vorerst ausgeblendet */} - {/* {selectedBillingInterval === 'one_time' && customerMode === 'select' && selectedEndCustomerId && ( -
- - setLastLicenseDate(e.target.value)} - className="bg-[#0b1329] border-white/10 text-white focus:border-primary" - /> -

- Falls dieser Kunde bereits Lizenzen besitzt, tragen Sie das Datum der letzten Lizenzierung ein. Damit werden die korrekten Update-Gebühren ermittelt. -

-
- )} */}