'use client' import styles from '@/app/styles/login.module.scss'; import { useActionState } from 'react'; import { registration } from '@/app/actions/auth'; import PhoneInput from '@/app/ui/inputs/phone-input'; import Link from 'next/link'; import { useTranslations } from 'next-intl'; export default function RegisterForm() { const [state, formAction, isPending] = useActionState( registration, undefined, ); const t = useTranslations('Login-register-form'); return (
{ formAction(e); }}>
{state?.error?.full_name && (

{t(state?.error?.full_name)}

)}
{state?.error?.email && (

{t(state?.error?.email)}

)}
{state?.error?.phone && (

{t(state?.error?.phone)}

)}
{state?.error?.password && (

{ state?.error?.password.split('&').map((e) => { return t(e) }) }

)}
{state?.error?.confirm_password && (

{t(state?.error?.confirm_password)}

)}
{state?.error?.agree && (

{t(state?.error?.agree)}

)} {state?.error?.server && (

{t(state?.error?.server)}

)}
) }