"use client"; import { useSearchParams } from "next/navigation"; import { InputOTP, InputOTPGroup, InputOTPSlot, } from "@/app/_components/ui/input-otp"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/app/_components/ui/card"; import { cn } from "@/app/_lib/utils"; import { Loader2 } from "lucide-react"; import { Controller } from "react-hook-form"; import { useVerifyOtpHandler } from "../handler"; import { Button } from "@/app/_components/ui/button"; interface VerifyOtpFormProps extends React.HTMLAttributes {} export function VerifyOtpForm({ className, ...props }: VerifyOtpFormProps) { const searchParams = useSearchParams() const email = searchParams.get("email") || "" const { register, control, handleVerifyOtp, handleOtpChange, errors, isPending } = useVerifyOtpHandler(email) return (
One-Time Password One time password is a security feature that helps protect your data
( handleOtpChange(value, field.onChange)} > {[...Array(6)].map((_, index) => ( ))} )} /> {errors.token ? (
{errors.token.message}
) : (
Successfully verified!
)}
Please enter the one-time password sent to {email}.
By clicking continue, you agree to Sigap's{" "} Terms of Service and Privacy Policy.
) }