import React, {FormEvent, useState} from "react" import Field from "../../components/Field" import useAxiosTools from "../../hooks/AxiosTools" const ForgotPassword = () => { const [email, setEmail] = useState('') const [message, setMessage] = useState(false) const {errorCatch, errorLabel, cleanErrors, axiosGet, axiosPost} = useAxiosTools() const handleSubmit = async (event: FormEvent) => { event.preventDefault() try { cleanErrors() await axiosGet('/sanctum/csrf-cookie') await axiosPost('/api/forgot', {email}) setMessage(true) } catch (error) { errorCatch(error) } } return