import { TestResult, FullTestResults, EDUCATION_CONTENT } from './types'
export function EducationCard({ stepId }: { stepId: string }) {
const content = EDUCATION_CONTENT[stepId]
if (!content) return null
return (
💡
Warum ist das wichtig?
{content.title}
{content.content.map((line, index) => (
{line}
))}
)
}
export function TestResultCard({ result }: { result: TestResult }) {
const statusColors = {
passed: 'bg-green-100 border-green-300 text-green-800',
failed: 'bg-red-100 border-red-300 text-red-800',
pending: 'bg-yellow-100 border-yellow-300 text-yellow-800',
skipped: 'bg-gray-100 border-gray-300 text-gray-600',
}
const statusIcons = {
passed: '✓',
failed: '✗',
pending: 'â—‹',
skipped: '−',
}
return (
{statusIcons[result.status]}
{result.name}
{result.description}
{result.duration_ms.toFixed(0)}ms
Erwartet:
{result.expected}
Erhalten:
{result.actual}
{result.error_message && (
Fehler: {result.error_message}
)}
)
}
export function TestSummaryCard({ results }: { results: FullTestResults }) {
const passRate = results.total_tests > 0
? ((results.total_passed / results.total_tests) * 100).toFixed(1)
: '0'
return (
Test-Ergebnisse
{/* Summary Stats */}
{results.total_tests}
Gesamt
{results.total_passed}
Bestanden
{results.total_failed}
Fehlgeschlagen
= 80 ? 'bg-green-50' : parseFloat(passRate) >= 50 ? 'bg-yellow-50' : 'bg-red-50'
}`}>
= 80 ? 'text-green-600' : parseFloat(passRate) >= 50 ? 'text-yellow-600' : 'text-red-600'
}`}>{passRate}%
Erfolgsrate
{/* Category Results */}
{results.categories.map((category) => (
{category.display_name}
{category.passed}/{category.total} bestanden
{category.description}
))}
{/* Duration */}
Gesamtdauer: {(results.duration_ms / 1000).toFixed(2)}s
)
}