import { useState } from "react";
import SendToken from "./SendToken";
import SendUserData from "./SendUserData";

const RegisterNavyComponent = () => {
  const [otpToken, setOtpToken] = useState(false);
  const [PhoneNumber, setPhoneNumber] = useState("");
  const [nationalId, setNationalId] = useState("");
  const [typeId, setTypeId] = useState("");

  if (!otpToken) {
    return (
      <SendUserData
        setOtpToken={setOtpToken}
        setPhoneNumber={setPhoneNumber}
        setNationalId={setNationalId}
        setTypeId={setTypeId}
        PhoneNumber={PhoneNumber}
        nationalId={nationalId}
      />
    );
  } else {
    return (
      <SendToken
        PhoneNumber={PhoneNumber}
        nationalId={nationalId}
        typeId={typeId}
        setOtpToken={setOtpToken}
      />
    );
  }
};

export default RegisterNavyComponent;
