import Link from 'next/link'; import { requireAdmin } from '@/lib/admin/auth'; import { eventsLog } from '@/lib/admin/queries'; import { AdminShell, fmtTs, n } from '@/components/admin/shell'; import { Table, th, td } from '@/components/ui/primitives'; export default async function EventsPage({ searchParams }: { searchParams: Promise<{ type?: string }> }) { await requireAdmin(); const sp = await searchParams; const { rows, types } = await eventsLog({ type: sp.type || undefined }); return ( all{types.map((t) => {String(t.type)} {n(t.n)})}}>
{rows.length === 0 ? : null} {rows.map((r) => ( ))}
WhenTypeEntityPayload
No events recorded yet.
{fmtTs(r.created_at)} {String(r.type)} {String(r.entity_type ?? '')} {String(r.entity_id ?? '')} {JSON.stringify(r.payload)}
); }