2024-10-23 15:24:52 +02:00
|
|
|
import Container from '../../ReusableComponents/Container.js';
|
|
|
|
import StepWelcome from './StepWelcome.js';
|
2024-10-24 06:35:48 +02:00
|
|
|
import StepBusiness from './StepBusiness';
|
|
|
|
import { useState } from '@wordpress/element';
|
2024-10-23 15:24:52 +02:00
|
|
|
|
|
|
|
const Onboarding = () => {
|
2024-10-24 06:35:48 +02:00
|
|
|
const [ step, setStep ] = useState( 0 );
|
|
|
|
|
2024-10-23 15:24:52 +02:00
|
|
|
return (
|
|
|
|
<Container>
|
|
|
|
<div className="ppcp-r-card">
|
2024-10-24 06:35:48 +02:00
|
|
|
<Stepper currentStep={ step } setStep={ setStep } />
|
2024-10-23 15:24:52 +02:00
|
|
|
</div>
|
|
|
|
</Container>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-10-24 06:35:48 +02:00
|
|
|
const Stepper = ( { currentStep, setStep } ) => {
|
|
|
|
const stepperOrder = {
|
|
|
|
0: StepWelcome,
|
|
|
|
1: StepBusiness,
|
|
|
|
};
|
|
|
|
|
|
|
|
const Component = stepperOrder[ currentStep ];
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Component setStep={ setStep } currentStep={ currentStep } />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-10-23 15:24:52 +02:00
|
|
|
export default Onboarding;
|