import { AdminLayout } from "./AdminLayout.tsx"; export const AuditLogPage = ({ logs, }: { logs: any[]; }) => { return (

Immutable Audit Ledger

Cryptographically chained Merkle audit trail for authentication, authorization, and administrative events.

{/* Desktop Table (≥ 768px) */} {/* Mobile Feed (< 768px) */}
{logs.map((log) => { const isFail = log.action.includes("fail") || log.action.includes("denied"); const isSuccess = log.action.includes("success") || log.action.includes("create") || log.action.includes("activate"); const badgeClass = isFail ? "badge-danger" : isSuccess ? "badge-success" : "badge-info"; return (
{log.action} {new Date(log.created_at).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit", })}
User: {log.user || "System"}
IP:{" "} {log.ip_address || "Internal"}
{log.details && (
View Event Payload
                    {JSON.stringify(log.details, null, 2)}
                  
)}
); })}
); };