'use client' import { authenticate } from '@/app/lib/actions' import { useFormState, useFormStatus } from 'react-dom' export default function Page() { const [errorMessage, dispatch] = useFormState(authenticate, undefined) return (
) } function LoginButton() { const { pending } = useFormStatus() const handleClick = (event) => { if (pending) { event.preventDefault() } } return ( ) }