'use client' import { useState } from 'react' import { signIn } from 'next-auth/react' import { useRouter } from 'next/navigation' import Image from 'next/image' export default function AdminLoginPage() { const router = useRouter() const [email, setEmail] = useState('') const [password, setPassword] = useState('') const [error, setError] = useState('') const [loading, setLoading] = useState(false) const handleSubmit = async (e: React.FormEvent) => { e.preventDefault() setLoading(true) setError('') const result = await signIn('credentials', { email, password, redirect: false, }) if (result?.error) { setError('Email veya şifre hatalı.') setLoading(false) } else { router.push('/tr/admin') } } return (
Vesta Muğla

Admin Paneli

setEmail(e.target.value)} placeholder="Email" required className="w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 text-white placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-vesta-earth/50" />
setPassword(e.target.value)} placeholder="Şifre" required className="w-full bg-white/10 border border-white/10 rounded-xl px-4 py-3 text-white placeholder:text-white/30 focus:outline-none focus:ring-2 focus:ring-vesta-earth/50" />
{error &&

{error}

}
) }