"use client";

import VerificationPage from "@/components/register/verificationPage";
import LogInPage from "@/components/register/LogInPage";
import { useState } from "react";
import LayoutRegister from "./LayoutRegister";

function RegisterPage({ matchedCity }) {
  const [isSendMsg, setIsSendMsg] = useState(false);
  const [uuid, setUuid] = useState("");
  const [num, setNum] = useState("");

  return (
    <LayoutRegister matchedCity={matchedCity}>
      {isSendMsg ? (
        <VerificationPage
          link="/"
          num={num}
          uuid={uuid}
          setStep={false}
          setUuid={setUuid}
          setIsSendMsg={setIsSendMsg}
        />
      ) : (
        <LogInPage
          num={num}
          setNum={setNum}
          setStep={false}
          setUuid={setUuid}
          matchedCity={matchedCity}
          setIsSendMsg={setIsSendMsg}
        />
      )}
    </LayoutRegister>
  );
}

export default RegisterPage;
