"use client"; import { useState, Suspense } from "react"; import { useRouter } from "next/navigation"; import { Card, CardContent } from "~/components/ui/card"; import { Input } from "~/components/ui/input"; import { Button } from "~/components/ui/button"; import { Label } from "~/components/ui/label"; import { toast } from "sonner"; import { Logo } from "~/components/branding/logo"; import { LegalModal } from "~/components/ui/legal-modal"; import { Mail, Lock, ArrowRight, User, Clock, Rocket, Zap } from "lucide-react"; function RegisterForm() { const router = useRouter(); const [firstName, setFirstName] = useState(""); const [lastName, setLastName] = useState(""); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); async function handleRegister(e: React.FormEvent) { e.preventDefault(); setLoading(true); const res = await fetch("/api/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ firstName, lastName, email, password, }), }); setLoading(false); if (res.ok) { toast.success("Account created successfully! Please sign in."); router.push("/auth/signin"); } else { const data = (await res.json()) as { error?: string }; toast.error(data.error ?? "Registration failed"); } } return (
Join thousands of freelancers and small businesses who trust beenvoice to manage their invoicing and get paid faster.
Get started in minutes with our intuitive setup wizard
Professional invoices that get you paid 3x faster
Track time and convert it to accurate invoices instantly
Supercharge your invoicing today