// Zentrale Schrittreihenfolge des Anmelde-Wizards. Einige Schritte sind optional und werden // übersprungen, wenn sie für das Event nicht zutreffen (Zusatzoptionen, Teilnahmeoptionen). // Der Zahlungsschritt wird separat in useSignupForm anhand des berechneten Betrags übersprungen. export const STEP_AGE = 1 export const STEP_CONTACT = 2 export const STEP_PERSONAL = 3 export const STEP_ARRIVAL = 4 export const STEP_REGISTRATION = 5 export const STEP_ADDONS = 6 export const STEP_PARTICIPATION_OPTIONS = 7 export const STEP_PHOTO = 8 export const STEP_ALLERGIES = 9 export const STEP_PAYMENT = 10 export const STEP_SUMMARY = 11 // Ob ein (optionaler) Schritt für dieses Event angezeigt wird. export function stepVisible(event, step) { if (step === STEP_ADDONS) { return (event.addons?.length ?? 0) > 0 } if (step === STEP_PARTICIPATION_OPTIONS) { return (event.participationOptions?.length ?? 0) > 0 } return true } // Nächster sichtbarer Schritt nach `step` (überspringt ausgeblendete optionale Schritte). export function nextVisibleFrom(event, step) { let candidate = step + 1 while (candidate < STEP_SUMMARY && !stepVisible(event, candidate)) { candidate++ } return candidate } // Vorheriger sichtbarer Schritt vor `step`. export function prevVisibleFrom(event, step) { let candidate = step - 1 while (candidate > STEP_AGE && !stepVisible(event, candidate)) { candidate-- } return candidate }