"use client";

import { useState } from "react";
import LoginForm from "./loginForm";
import VerifyCode from "./verifyCode";
import ForgotPassword from "./forgetPassword";
import {Step} from "@/types/types"



export default function AuthCard() {
  const [step, setStep] = useState<Step>("login");

  return (
    <>
      {step === "login" && (
        <LoginForm
          onSuccess={() => setStep("verify")}
          onForgotPassword={() => setStep("forgot")}
        />
      )}

      {step === "verify" && (
        <VerifyCode onBack={() => setStep("login")} />
      )}

      {step === "forgot" && (
        <ForgotPassword onBack={() => setStep("login")} />
      )}
    </>
  );
}