//1. Implementing 2 steps in Login using hashmap
// frontendsrcpagesLoginLogin.jsx
import StepPhoneEmail from '../Steps/StepPhoneEmail/StepPhoneEmail';
const steps = {
1: StepPhoneEmail,
2: StepOtp,
};
const Login = () => {
const [step, setStep] = useState(1);
//select component according to step
const Step = steps[step];
function onNext() {
setStep(step + 1);
}
return <Step onNext={onNext} />;
};