import { useForm } from 'react-hook-form' import { Link } from 'react-router-dom' import { Button, Card, ControlledTextField, Typography } from '@/components' import { DevTool } from '@hookform/devtools' import { zodResolver } from '@hookform/resolvers/zod' import { z } from 'zod' import s from './recover-password.module.scss' const schema = z.object({ email: z.string().email('Invalid email address').nonempty('Enter email'), }) type FormType = z.infer type Props = { onSubmit: (data: FormType) => void } export const RecoverPassword = (props: Props) => { const { control, handleSubmit } = useForm({ defaultValues: { email: '', }, mode: 'onSubmit', resolver: zodResolver(schema), }) const handleFormSubmitted = handleSubmit(props.onSubmit) return ( <> Forgot your password?
Enter your email address and we will send you further instructions
Did you remember your password? Try logging in
) }