import React, { useEffect } from 'react'; import Button from '@/Components/Button'; import Checkbox from '@/Components/Checkbox'; import Guest from '@/Layouts/Guest'; import Input from '@/Components/Input'; import Label from '@/Components/Label'; import ValidationErrors from '@/Components/ValidationErrors'; import { Head, Link, useForm } from '@inertiajs/inertia-react'; export default function Login({ status, canResetPassword }) { const { data, setData, post, processing, errors, reset } = useForm({ email: '', password: '', remember: '', }); useEffect(() => { return () => { reset('password'); }; }, []); const onHandleChange = (event) => { setData(event.target.name, event.target.type === 'checkbox' ? event.target.checked : event.target.value); }; const submit = (e) => { e.preventDefault(); post(route('login')); }; return ( {status &&
{status}
}
{canResetPassword && ( Forgot your password? )}
); }