"use client"; import Link from "next/link"; import { useState } from "react"; import { useRouter } from "next/navigation"; import { signIn } from "next-auth/react"; import { Card, CardContent, CardHeader, CardTitle } 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/logo"; import { Mail, Lock, ArrowRight } from "lucide-react"; export default function SignInPage() { const router = useRouter(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [loading, setLoading] = useState(false); async function handleSignIn(e: React.FormEvent) { e.preventDefault(); setLoading(true); const result = await signIn("credentials", { email, password, redirect: false, }); setLoading(false); if (result?.error) { toast.error("Invalid email or password"); } else { toast.success("Signed in successfully!"); router.push("/dashboard"); router.refresh(); } } return (
{/* Logo and Welcome */}

Welcome back

Sign in to your beenvoice account

{/* Sign In Form */} Sign In
setEmail(e.target.value)} required autoFocus className="pl-10" placeholder="Enter your email" />
setPassword(e.target.value)} required className="pl-10" placeholder="Enter your password" />
Don't have an account? Create one now
{/* Features */}

Simple invoicing for freelancers and small businesses

✓ Easy client management ✓ Professional invoices ✓ Payment tracking
); }