Files
breakpilot-compliance/admin-compliance/app/sdk/training/_components/AuditTab.tsx
Sharang Parnerkar 375b34a0d8 refactor(admin): split consent-management, control-library, incidents, training pages
Agent-completed splits committed after agents hit rate limits before
committing their work. All 4 pages now under 500 LOC:

- consent-management: 1303 -> 193 LOC (+ 7 _components, _hooks, _data, _types)
- control-library: 1210 -> 298 LOC (+ _components, _types)
- incidents: 1150 -> 373 LOC (+ _components)
- training: 1127 -> 366 LOC (+ _components)

Verification: next build clean (142 pages generated).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-12 15:52:45 +02:00

38 lines
1.5 KiB
TypeScript

'use client'
import type { AuditLogEntry } from '@/lib/sdk/training/types'
interface AuditTabProps {
auditLog: AuditLogEntry[]
}
export function AuditTab({ auditLog }: AuditTabProps) {
return (
<div className="space-y-4">
<div className="overflow-x-auto">
<table className="w-full text-sm border-collapse">
<thead>
<tr className="bg-gray-50">
<th className="text-left p-2 border font-medium text-gray-700">Zeitpunkt</th>
<th className="text-left p-2 border font-medium text-gray-700">Aktion</th>
<th className="text-left p-2 border font-medium text-gray-700">Entitaet</th>
<th className="text-left p-2 border font-medium text-gray-700">Details</th>
</tr>
</thead>
<tbody>
{auditLog.map(entry => (
<tr key={entry.id} className="border-b hover:bg-gray-50">
<td className="p-2 border text-xs text-gray-600">{new Date(entry.created_at).toLocaleString('de-DE')}</td>
<td className="p-2 border"><span className="px-2 py-0.5 rounded text-xs bg-gray-100 text-gray-700">{entry.action}</span></td>
<td className="p-2 border text-xs">{entry.entity_type}</td>
<td className="p-2 border text-xs text-gray-600">{JSON.stringify(entry.details).substring(0, 100)}</td>
</tr>
))}
</tbody>
</table>
</div>
{auditLog.length === 0 && <p className="text-center text-gray-500 py-8">Keine Audit-Eintraege</p>}
</div>
)
}