"use client"; import { useActionState } from "react"; import Link from "next/link"; import { signup } from "@/lib/actions/auth"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; export function SignupForm() { const [state, action, pending] = useActionState(signup, undefined); return ( Créer un compte Postez un besoin ou répondez aux besoins des autres.
{state?.errors?.fullName && (

{state.errors.fullName[0]}

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

{state.errors.email[0]}

)}
{state?.errors?.password && (
    {state.errors.password.map((error) => (
  • {error}
  • ))}
)}
{state?.message && (

{state.message}

)}

Déjà un compte ?{" "} Se connecter

); }