import React, { useEffect } from 'react'
import { Head, useForm } from '@inertiajs/react'
import { Button, TextInput, Label, Checkbox, Spinner } from 'flowbite-react'
import GuestLayout from '@/Layouts/GuestLayout'
import InputError from '@/Components/Defaults/InputError'
export default function Login({ status }) {
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 handleKeyDown = (e) => {
if (e.code === 'Enter') {
post(route('admin.login'))
}
}
const submit = (e) => {
e.preventDefault()
post(route('admin.login'))
}
return (