'use client'; import { useState } from 'react'; import { createClient } from '@/utils/supabase/client'; 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 supabase = createClient(); const handleLogin = async (e: React.FormEvent) => { e.preventDefault(); setIsLoading(true); setError(null); const { error } = await supabase.auth.signInWithPassword({ email, password, }); if (error) { setError(error.message); setIsLoading(false); } else { router.push('/admin'); router.refresh(); } }; 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

); }