'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; export default function AdminLogin() { const router = useRouter(); const [credentials, setCredentials] = useState({ username: '', password: '' }); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(''); // Basit auth - production'da backend ile yapılmalı if (credentials.username === 'admin' && credentials.password === 'A2Metro2025!') { localStorage.setItem('admin_token', 'authenticated'); router.push('/yonetim-paneli-a2m-secure/dashboard'); } else { setError('Kullanıcı adı veya şifre hatalı'); setLoading(false); } }; return (
{/* Logo ve Başlık */}

Yönetim Paneli

A2 Metro Hattı İnşaat Projesi

{/* Login Form */}
{error && (
{error}
)}
setCredentials({ ...credentials, username: e.target.value })} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#00B4D8] focus:border-transparent outline-none transition-all text-gray-900" placeholder="Kullanıcı adınızı girin" required />
setCredentials({ ...credentials, password: e.target.value })} className="w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-[#00B4D8] focus:border-transparent outline-none transition-all text-gray-900" placeholder="Şifrenizi girin" required />
{/* Footer */}

© 2025 Ankara Büyükşehir Belediyesi

); }