"use client"; import React, { useState } from 'react'; import { motion } from 'framer-motion'; import { useRouter } from 'next/navigation'; export default function LoginPage() { const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(''); const [isLoading, setIsLoading] = useState(false); const router = useRouter(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); setError(''); try { const res = await fetch('/admin/api/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ username, password }), }); if (res.ok) { router.push('/admin/projects'); router.refresh(); } else { setError('Geçersiz kullanıcı adı veya şifre.'); } } catch (err) { setError('Bir hata oluştu. Lütfen tekrar deneyin.'); } finally { setIsLoading(false); } }; return (
A

Hoş Geldiniz

Yönetim Paneli Girişi

setUsername(e.target.value)} className="w-full bg-white/5 border border-white/10 rounded-2xl px-6 py-4 text-white placeholder:text-gray-700 focus:outline-none focus:ring-2 focus:ring-cyan-500/50 transition-all font-medium" placeholder="isminiz..." />
setPassword(e.target.value)} className="w-full bg-white/5 border border-white/10 rounded-2xl px-6 py-4 text-white placeholder:text-gray-700 focus:outline-none focus:ring-2 focus:ring-cyan-500/50 transition-all font-medium" placeholder="••••••••" />
{error && ( {error} )}

SECURED BY ANT-ARCHITECT

); }