import Button from "@/utils/button"; import OTPInput from "./otpInput"; import { useEffect, useState, } from "react"; import {Props} from "@/constants/types" export default function VerifyCode({ onBack }: Props) { const [timer, setTimer] = useState(30); //Timer Functionality Sets 30s to 0s useEffect(() => { if (timer === 0) return; const interval = setInterval(() => { setTimer((prev) => prev - 1); }, 1000); return () => clearInterval(interval); }, [timer]); const handleResend = () => { if (timer > 0) return; // Call your resend OTP setTimer(30); }; return (
Enter the 6-digit code from your authenticator app, or the
code we sent to{" "}
d•••@kafm.io
.