import { prisma } from "@/lib/prisma"; import { BackLink } from "@/components/back-link"; import { formatDateTime } from "@/lib/format"; import { getLocale } from "@/i18n/locale"; import { getDictionary } from "@/i18n/get-dictionary"; const RECENT_LIMIT = 200; export default async function AdminAuditLogPage() { const t = getDictionary(await getLocale()); const entries = await prisma.auditLog.findMany({ orderBy: { createdAt: "desc" }, take: RECENT_LIMIT, }); return (
{t.adminAuditLogPage.intro(RECENT_LIMIT)}
| {t.adminAuditLogPage.colTimestamp} | {t.adminAuditLogPage.colAdmin} | {t.adminAuditLogPage.colAction} | {t.adminAuditLogPage.colObject} | {t.adminAuditLogPage.colDetails} |
|---|---|---|---|---|
| {formatDateTime(entry.createdAt)} | {entry.adminEmail} | {entry.action} | {entry.entityType} {entry.entityId ? #{entry.entityId.slice(-6)} : null} | {entry.detail ?? "—"} |
{t.adminAuditLogPage.noEntriesYet}
: null}