'use client' import { useState } from 'react' import { useRouter } from 'next/navigation' import Link from 'next/link' import Image from 'next/image' import { useStore } from '@/lib/store' import { Loader2, ArrowRight, Eye, EyeOff } from 'lucide-react' // Logo Component - Puma Image function Logo() { return ( ) } export default function LoginPage() { const router = useRouter() const { login } = useStore() const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [showPassword, setShowPassword] = useState(false) const [error, setError] = useState(null) const [loading, setLoading] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setError(null) setLoading(true) try { await login(email, password) router.push('/dashboard') } catch (err) { setError(err instanceof Error ? err.message : 'Authentication failed') } finally { setLoading(false) } } return ( {/* Ambient glow */} {/* Logo */} {/* Header */} Welcome back Sign in to access your watchlist {/* Form */} {error && ( {error} )} setEmail(e.target.value)} placeholder="Email address" required className="input-elegant text-body-sm sm:text-body" /> setPassword(e.target.value)} placeholder="Password" required minLength={8} className="input-elegant text-body-sm sm:text-body pr-12" /> setShowPassword(!showPassword)} className="absolute right-3 sm:right-4 top-1/2 -translate-y-1/2 text-foreground-muted hover:text-foreground transition-colors duration-200" aria-label={showPassword ? 'Hide password' : 'Show password'} > {showPassword ? ( ) : ( )} {loading ? ( ) : ( <> Continue > )} {/* Register Link */} Don't have an account?{' '} Create one ) }
Sign in to access your watchlist
{error}
Don't have an account?{' '} Create one