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>
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
'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>
|
|
)
|
|
}
|