"use client"; import Link from "next/link"; import { useActionState } from "react"; import { Button } from "@/components/ui/button"; import { register } from "@/actions/auth"; export default function RegistracePage() { const [state, formAction, pending] = useActionState(register, {}); return (

Registrace

Už máš účet?{" "} Přihlás se

{state.error && (
{state.error}
)}
{state.fieldErrors?.name && (

{state.fieldErrors.name[0]}

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

{state.fieldErrors.email[0]}

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

{state.fieldErrors.password[0]}

)}
); }