Files
breakpilot-lehrer/website/app/admin/unity-bridge/_components/DiagnosticPanel.tsx
Benjamin Admin 0b37c5e692 [split-required] Split website + studio-v2 monoliths (Phase 3 continued)
Website (14 monoliths split):
- compliance/page.tsx (1,519 → 9), docs/audit (1,262 → 20)
- quality (1,231 → 16), alerts (1,203 → 10), docs (1,202 → 11)
- i18n.ts (1,173 → 8 language files)
- unity-bridge (1,094 → 12), backlog (1,087 → 6)
- training (1,066 → 8), rag (1,063 → 8)
- Deleted index_original.ts (4,899 LOC dead backup)

Studio-v2 (5 monoliths split):
- meet/page.tsx (1,481 → 9), messages (1,166 → 9)
- AlertsB2BContext.tsx (1,165 → 5 modules)
- alerts-b2b/page.tsx (1,019 → 6), korrektur/archiv (1,001 → 6)

All existing imports preserved. Zero new TypeScript errors.

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

61 lines
1.8 KiB
TypeScript

'use client'
import type { DiagnosticEntry } from './types'
export function DiagnosticPanel({
diagnostics,
isLoading,
onRun,
}: {
diagnostics: DiagnosticEntry[]
isLoading: boolean
onRun: () => void
}) {
const severityColors = {
ok: 'text-green-600 bg-green-50',
warning: 'text-yellow-600 bg-yellow-50',
error: 'text-red-600 bg-red-50',
}
const severityIcons = {
ok: '✓',
warning: '⚠',
error: '✕',
}
return (
<div className="bg-white rounded-lg border border-gray-200 shadow-sm">
<div className="flex items-center justify-between px-4 py-3 border-b border-gray-200">
<h3 className="font-semibold text-gray-900">Diagnostik</h3>
<button
onClick={onRun}
disabled={isLoading}
className="px-3 py-1.5 text-sm bg-primary-600 text-white rounded hover:bg-primary-700 disabled:opacity-50 transition-colors"
>
{isLoading ? 'Prüfe...' : 'Diagnose starten'}
</button>
</div>
<div className="p-4">
{diagnostics.length === 0 ? (
<p className="text-gray-500 text-center py-4">
Klicke auf &quot;Diagnose starten&quot; um die Szene zu prüfen
</p>
) : (
<div className="space-y-2">
{diagnostics.map((d, index) => (
<div
key={index}
className={`flex items-center gap-3 p-2 rounded ${severityColors[d.severity]}`}
>
<span className="font-bold">{severityIcons[d.severity]}</span>
<span className="text-sm font-medium">{d.category}</span>
<span className="text-sm flex-1">{d.message}</span>
</div>
))}
</div>
)}
</div>
</div>
)
}