import {useState} from "react";
import RequestOtpComponent from "../RequestOtp";
import UserRegisterComponent from "./UserRegister";

const NavyComponent = () => {
    const [otpToken, setOtpToken] = useState(false);
    const [PhoneNumber, setPhoneNumber] = useState("");

    // For Resend Token (read ResendToken Component Doc)
    const initialTimerValue = 30;
    const [timer, setTimer] = useState(initialTimerValue);
    // End For Resend Token

    if (!otpToken) {
        return (
            <RequestOtpComponent
                setOtpToken={setOtpToken}
                PhoneNumber={PhoneNumber}
                setPhoneNumber={setPhoneNumber}
                setTimer={setTimer}
                initialTimerValue={initialTimerValue}
            />
        );
    } else {
        return (
            <UserRegisterComponent
                PhoneNumber={PhoneNumber}
                setOtpToken={setOtpToken}
                timer={timer}
                setTimer={setTimer}
                initialTimerValue={initialTimerValue}
            />
        );
    }
};

export default NavyComponent;
