'use client' import { useState } from 'react' import { signIn } from 'next-auth/react' import { useRouter } from 'next/navigation' export default function LoginPage() { 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', { redirect: false, email, password, }) if (result?.error) { setError('Geçersiz e-posta veya şifre') setLoading(false) } else { router.push('/admin') router.refresh() } } return (
{/* Logo & Brand Header */}
ML

marmaris local

backoffice admin login

{error && (
{error}
)}
setEmail(e.target.value)} required className="w-full px-4 py-3 border border-pine/15 rounded-xl focus:ring-2 focus:ring-turquoise focus:border-turquoise bg-stone/20 text-pine text-sm transition-colors outline-none font-medium min-h-[44px]" placeholder="admin@ayris.tech" />
setPassword(e.target.value)} required className="w-full px-4 py-3 border border-pine/15 rounded-xl focus:ring-2 focus:ring-turquoise focus:border-turquoise bg-stone/20 text-pine text-sm transition-colors outline-none font-medium min-h-[44px]" placeholder="••••••••" />
) }