'use client'; import { useState } from 'react'; import { useRouter } from 'next/navigation'; import { Lock, Mail, Loader2, Wallet } from 'lucide-react'; export default function LoginPage() { const [email, setEmail] = useState(''); const [password, setPassword] = useState(''); const [isLoading, setIsLoading] = useState(false); const [error, setError] = useState(null); const router = useRouter(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); setError(null); try { const res = await fetch('/api/auth/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, password }) }); const data = await res.json(); if (!res.ok) { setError(data.error || 'Login failed'); } else { router.push('/admin'); router.refresh(); } } catch (err: any) { setError('Bir ağ hatası oluştu, lütfen tekrar deneyin.'); } finally { setIsLoading(false); } }; return (

Admin Login

Management Portal

setEmail(e.target.value)} placeholder="admin@p2cgateway.com" className="w-full pl-14 pr-6 py-4 bg-gray-50 border-none rounded-2xl text-sm font-medium focus:ring-2 focus:ring-blue-500 outline-none" />
setPassword(e.target.value)} placeholder="••••••••" className="w-full pl-14 pr-6 py-4 bg-gray-50 border-none rounded-2xl text-sm font-medium focus:ring-2 focus:ring-blue-500 outline-none" />
{error && (
{error}
)}

Secure encrypted session

); }