"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 } from "lucide-react" export default function LoginPage() { 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 result = await signIn("credentials", { email: formData.get("email"), password: formData.get("password"), redirect: false, }) if (result?.error) { setError("Invalid email or password") } else { router.push("/create") router.refresh() } } catch (error) { setError("Something went wrong") } finally { setIsLoading(false) } } return (
{/* Left Panel - Branding */}
{/* Background Pattern */}
{/* Content */}
AI Powered

Create Art That
Breaks Limits

Join thousands of artists using Imyra to transform imagination into stunning visuals.

{/* Stats */}

50K+

Artworks

10K+

Artists

Free

To Start

{/* Right Panel - Form */}
{/* Logo */}
Imyra

Welcome back

Enter your credentials to access your creative studio

{error && (
{error}
)}
Forgot password?
Or

Don't have an account?{" "} Create one free

) }