"use client"; import { useState } from "react"; import { login } from "@/app/actions/auth"; export default function LoginClient() { const [loading, setLoading] = useState(false); const [error, setError] = useState(null); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setLoading(true); setError(null); const formData = new FormData(e.currentTarget); const result = await login(formData); if (result.success) { window.location.href = "/admin"; // Başarılı giriş } else { setError(result.error || "Giriş başarısız."); setLoading(false); } }; return (
Kozmos Logo

Yönetim Paneline Giriş Yapın

{error && (
{error}
)}
← Siteye Geri Dön
); }