diff --git a/components/wizard.js b/components/wizard.js index e0d831b..7fef7b3 100644 --- a/components/wizard.js +++ b/components/wizard.js @@ -22,7 +22,26 @@ function WizardInternal() { const isLastStep = currentStep === STEPS.length - 1 return ( -
+ { + event.preventDefault() + + const fd = new FormData(event.currentTarget) + for (const [key, value] of fd.entries()) { + console.log(key, value) + } + + console.log(state) + + return + + if (!isLastStep) { + dispatch({ type: ACTIONS.NEXT_STEP }) + return + } + dispatch({ type: ACTIONS.SUBMIT }) + }} + > {STEPS.map(({ id, component: Component }, index) => ( <>{currentStep === index && } ))} @@ -34,14 +53,8 @@ function WizardInternal() { Zurück )} - {!isLastStep && ( - - )} - {isLastStep && ( - - )} + {!isLastStep && } + {isLastStep && } ) }