import Link from "next/link"; import Image from "next/image"; import { Button } from "@/components/ui"; import { getLocale, getTranslator } from "@/lib/i18n"; import { getSession } from "@/lib/auth"; export default async function LoginPage({ searchParams }: { searchParams?: Promise<{ error?: string; next?: string }>; }) { const locale = await getLocale(); const t = getTranslator(locale); const params = await (searchParams ?? Promise.resolve({ error: undefined, next: undefined })); const error = params?.error; const next = params?.next ?? ""; const session = await getSession(); const errorMessage = error === "credentials_required" ? t("login", "error_credentials_required") : error === "invalid_credentials" ? t("login", "error_invalid_credentials") : error === "rate_limited" ? t("login", "error_rate_limited") : null; return (
ZappCare

{t("login", "title")}

{t("login", "signin_subtitle")}

3

Role aktif saat ini

10+

Modul operasi aktif

{t("login", "signin_label")}

{t("login", "signin_subtitle")}

{t("login", "signin_help")}

{session ? (

Session aktif: {session.fullName} • {session.role} • {session.tenantName}

) : null} {errorMessage ? (

{errorMessage}

) : null}

{t("login", "no_account_label")} {t("login", "contact_admin")}

{t("login", "remember_label")}
); }