"use client"; import { useState, useTransition } from "react"; import { signIn } from "next-auth/react"; import { useRouter } from "next/navigation"; export default function LoginForm({ dict, lang }: { dict: any; lang: string }) { const router = useRouter(); const [email, setEmail] = useState(""); const [password, setPassword] = useState(""); const [error, setError] = useState(""); const [isPending, startTransition] = useTransition(); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); setError(""); startTransition(async () => { const res = await signIn("credentials", { email, password, redirect: false, }); if (res?.error) { setError(dict.errorInvalid || "E-posta veya şifre hatalı."); } else { router.push(`/${lang}/dashboard`); router.refresh(); } }); }; return (

{dict.title || "AyrisMail Central"}

{dict.subtitle || "Mail sunucunuzu kolayca yönetin"}

{error &&
{error}
}
setEmail(e.target.value)} required autoComplete="email" />
setPassword(e.target.value)} required autoComplete="current-password" />

AyrisTech © {new Date().getFullYear()} — Tüm hakları saklıdır.

); }