"use client" import { useState } from "react" import Link from "next/link" import { useRouter } from "next/navigation" import { signIn } from "next-auth/react" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Loader2, Sparkles, Eye, EyeOff, Check } from "lucide-react" export default function SignupPage() { const router = useRouter() const [isLoading, setIsLoading] = useState(false) const [showPassword, setShowPassword] = useState(false) const [error, setError] = useState("") async function onSubmit(e: React.FormEvent) { e.preventDefault() setIsLoading(true) setError("") const formData = new FormData(e.currentTarget) try { const res = await fetch("/api/auth/register", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ name: formData.get("name"), email: formData.get("email"), password: formData.get("password"), }), }) if (!res.ok) { const data = await res.json() setError(data.error || "Something went wrong") return } // Auto sign in after registration const result = await signIn("credentials", { email: formData.get("email"), password: formData.get("password"), redirect: false, }) if (result?.ok) { router.push("/create") router.refresh() } } catch (error) { setError("Something went wrong") } finally { setIsLoading(false) } } const features = [ "100 free credits daily", "Access to all AI models", "High-resolution exports", "Public gallery showcase", "No credit card required" ] return (
{/* Left Panel - Form */}
{/* Logo */}
Imyra

Start creating

Create your account and get 100 free credits instantly

{error && (
{error}
)}
Or

Already have an account?{" "} Sign in

{/* Right Panel - Features */}
{/* Background Pattern */}
{/* Content */}
Free Forever

Everything you need to create Stunning Art

    {features.map((feature, index) => (
  • {feature}
  • ))}
{/* Testimonial */}

"Imyra has completely transformed how I create visual content. The quality is incredible!"

S

Sarah Chen

Digital Artist

) }