'use client'; import { useActionState } from 'react'; import { useFormStatus } from 'react-dom'; import { authenticate } from '@/app/actions/auth'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import Link from 'next/link'; import { useLanguage } from '@/lib/i18n'; function LoginButton() { const { pending } = useFormStatus(); const { t } = useLanguage(); return ( ); } export function LoginForm({ allowRegister = true }: { allowRegister?: boolean }) { const [errorMessage, dispatch] = useActionState(authenticate, undefined); const { t } = useLanguage(); return (

{t('auth.signInToAccount')}

{t('auth.forgotPassword')}
{errorMessage && (

{errorMessage}

)}
{allowRegister && (
{t('auth.noAccount')}{' '} {t('auth.signUp')}
)}
); }