"use client"; import { useActionState, useEffect } from "react"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card"; import { loginAction, type LoginResult } from "@/actions/auth"; import { toast } from "sonner"; const initial: LoginResult = { ok: false, error: "" }; export function LoginForm() { const router = useRouter(); const [state, formAction, pending] = useActionState(loginAction, initial); useEffect(() => { if (!state.ok) { toast.error(state.error); } }, [state]); return ( Sign in Enter your credentials to access RJ Bulk.

New here?{" "} Create an account

); }