refactor(admin): split dsfa, audit-llm, quality pages

Extract components and hooks from oversized page files (563/561/520 LOC)
into colocated _components/ and _hooks/ subdirectories. All three
page.tsx files are now thin orchestrators under 300 LOC each
(dsfa: 216, audit-llm: 121, quality: 163). Zero behavior changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Sharang Parnerkar
2026-04-16 13:20:17 +02:00
parent 653fa07f57
commit 519ffdc8dc
16 changed files with 1246 additions and 1206 deletions

View File

@@ -0,0 +1,54 @@
'use client'
export interface QualityTest {
id: string
name: string
status: 'passed' | 'failed' | 'warning' | 'pending'
last_run: string
duration: string | null
ai_system: string | null
details: string | null
}
export function TestRow({ test, onDelete }: { test: QualityTest; onDelete: (id: string) => void }) {
const statusColors = {
passed: 'bg-green-100 text-green-700',
failed: 'bg-red-100 text-red-700',
warning: 'bg-yellow-100 text-yellow-700',
pending: 'bg-gray-100 text-gray-500',
}
const statusLabels = {
passed: 'Bestanden',
failed: 'Fehlgeschlagen',
warning: 'Warnung',
pending: 'Ausstehend',
}
return (
<tr className="hover:bg-gray-50">
<td className="px-6 py-4">
<div className="font-medium text-gray-900">{test.name}</div>
{test.ai_system && <div className="text-xs text-gray-500">{test.ai_system}</div>}
</td>
<td className="px-6 py-4">
<span className={`px-2 py-1 text-xs rounded-full ${statusColors[test.status]}`}>
{statusLabels[test.status]}
</span>
</td>
<td className="px-6 py-4 text-sm text-gray-500">
{new Date(test.last_run).toLocaleString('de-DE')}
</td>
<td className="px-6 py-4 text-sm text-gray-500">{test.duration || '-'}</td>
<td className="px-6 py-4 text-sm text-gray-500 max-w-xs truncate">{test.details || '-'}</td>
<td className="px-6 py-4">
<button
onClick={() => { if (window.confirm(`"${test.name}" loeschen?`)) onDelete(test.id) }}
className="text-sm text-red-400 hover:text-red-600"
>
Loeschen
</button>
</td>
</tr>
)
}