"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 (
{/* Hero Section - Hidden on mobile */}

Start your invoicing journey

Join thousands of freelancers and small businesses who trust beenvoice to manage their invoicing and get paid faster.

Quick Setup

Get started in minutes with our intuitive setup wizard

Fast Payments

Professional invoices that get you paid 3x faster

Time Tracking

Track time and convert it to accurate invoices instantly

{/* Sign Up Form */}
{/* Mobile Logo */}

Create your account

Supercharge your invoicing today

setFirstName(e.target.value)} required autoFocus className="h-11 pl-10" placeholder="John" />
setLastName(e.target.value)} required className="h-11 pl-10" placeholder="Doe" />
setEmail(e.target.value)} required className="h-11 pl-10" placeholder="john@example.com" />
setPassword(e.target.value)} required className="h-11 pl-10" placeholder="Create a strong password" />

Must be at least 8 characters long

Already have an account?{" "} Sign in
By creating an account, you agree to our{" "} Terms of Service } />{" "} and{" "} Privacy Policy } /> .
); } export default function RegisterPage() { return ( Loading...}> ); }