"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"; import { SignupMode } from "@/lib/generated/prisma/enums"; export function SignupForm({ mode }: { mode: SignupMode }) { const [state, action, pending] = useActionState(signup, undefined); if (state?.pending) { return ( Account created An administrator needs to approve your account before you can log in. Check back soon. ); } return ( Create your account {mode === SignupMode.APPROVED ? "An administrator will need to approve your account before you can log in." : "Start organizing in a minute."}
{state?.error &&

{state.error}

}

Already have an account?{" "} Log in

); }