'use client'
import { StatCard } from './StatCard'
import { formatNumber, type ComplianceReport } from './types'
export function ComplianceTab({ complianceReport }: { complianceReport: ComplianceReport }) {
return (
{/* Summary Cards */}
0}
/>
0.05}
/>
{complianceReport.policy_violations > 0 && (
{complianceReport.policy_violations} Policy-Verletzungen im Zeitraum
)}
{/* PII Categories */}
PII-Kategorien
{Object.entries(complianceReport.top_pii_categories || {}).length === 0 ? (
Keine PII erkannt
) : (
{Object.entries(complianceReport.top_pii_categories).sort((a, b) => b[1] - a[1]).map(([cat, count]) => (
{cat}
{count}
))}
)}
{/* Namespace Breakdown */}
Namespace-Analyse
{Object.entries(complianceReport.namespace_breakdown || {}).length === 0 ? (
Keine Namespace-Daten
) : (
| Namespace |
Requests |
PII |
{Object.entries(complianceReport.namespace_breakdown).map(([ns, data]) => (
| {ns} |
{formatNumber(data.requests)} |
{data.pii_incidents > 0 ? (
{data.pii_incidents}
) : (
0
)}
|
))}
)}
{/* User Breakdown */}
{Object.entries(complianceReport.user_breakdown || {}).length > 0 && (
Top-Nutzer
| User-ID |
Requests |
PII-Vorfaelle |
{Object.entries(complianceReport.user_breakdown)
.sort((a, b) => b[1].requests - a[1].requests)
.slice(0, 10)
.map(([userId, data]) => (
| {userId} |
{formatNumber(data.requests)} |
{data.pii_incidents > 0 ? (
{data.pii_incidents}
) : (
0
)}
|
))}
)}
)
}