"use client" import { Button } from "@/components/ui/button" import { IconInput } from "@/components/ui/icon-input" import { Label } from "@/components/ui/label" import { notifySuccess } from "@/lib/toast" import { standardSchemaResolver } from "@hookform/resolvers/standard-schema" import { Mail } from "lucide-react" import Link from "next/link" import { useForm } from "react-hook-form" import { z } from "zod" const forgotSchema = z.object({ email: z.string().email("请输入正确的邮箱地址"), }) export default function ForgotPasswordPage() { const { register, handleSubmit, formState: { errors, isSubmitting }, } = useForm({ resolver: standardSchemaResolver(forgotSchema), }) const onSubmit = async (_data: z.infer) => { await new Promise((r) => setTimeout(r, 500)) notifySuccess("重置链接已发送到你的邮箱") } return ( <>

找回密码

输入注册邮箱,我们将发送重置链接

} type="email" placeholder="输入注册邮箱" {...register("email")} /> {errors.email &&

{errors.email.message}

}

想起密码了?{" "} 返回登录

) }