'use client' import { useState, useEffect } from 'react' import { useSDK } from '@/lib/sdk' import { useAuditData } from './_hooks/useAuditData' import { LLMLogTab } from './_components/LLMLogTab' import { UsageTab } from './_components/UsageTab' import { ComplianceTab } from './_components/ComplianceTab' import type { TabId } from './_components/types' const tabs: { id: TabId; label: string }[] = [ { id: 'llm-log', label: 'LLM-Log' }, { id: 'usage', label: 'Nutzung' }, { id: 'compliance', label: 'Compliance' }, ] export default function AuditLLMPage() { const { state } = useSDK() const [activeTab, setActiveTab] = useState('llm-log') const [period, setPeriod] = useState('7d') const [logFilter, setLogFilter] = useState({ model: '', pii: '' }) const { logEntries, usageStats, complianceReport, loading, error, loadLLMLog, loadUsage, loadCompliance, handleExport, } = useAuditData(period, logFilter) useEffect(() => { if (activeTab === 'llm-log') loadLLMLog() else if (activeTab === 'usage') loadUsage() else if (activeTab === 'compliance') loadCompliance() }, [activeTab, loadLLMLog, loadUsage, loadCompliance]) return (

LLM Audit Dashboard

Monitoring und Compliance-Analyse der LLM-Operationen

{tabs.map(tab => ( ))}
{error && (
{error}
)} {loading && (
)} {!loading && activeTab === 'llm-log' && ( )} {!loading && activeTab === 'usage' && usageStats && ( )} {!loading && activeTab === 'compliance' && complianceReport && ( )} {!loading && activeTab === 'usage' && !usageStats && !error && (
Keine Nutzungsdaten verfuegbar
)} {!loading && activeTab === 'compliance' && !complianceReport && !error && (
Kein Compliance-Report verfuegbar
)}
) }