import { FormEventHandler, useEffect } from "react"; import GuestLayout from "@/Layouts/GuestLayout"; import { Head, Link, useForm } from "@inertiajs/react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/Components/ui/card"; import { Label } from "@/Components/ui/label"; import { Input } from "@/Components/ui/input"; import { Button } from "@/Components/ui/button"; import { InputError } from "@/Components/ui/InputError"; export default function Login({ status, canResetPassword, }: { status?: string; canResetPassword: boolean; }) { const { data, setData, post, processing, errors, reset } = useForm({ email: "", password: "", remember: false, }); useEffect(() => { return () => { reset("password"); }; }, []); const submit: FormEventHandler = (e) => { e.preventDefault(); post(route("login")); }; return (
Login Enter your email below to login to your account {status && (
{status}
)}
setData("email", e.target.value) } required />
Forgot your password?
setData("password", e.target.value) } required />
Don't have an account?{" "} Sign up
); }