'use client'
import type { TrainingStats, DeadlineInfo } from '@/lib/sdk/training/types'
import { STATUS_COLORS, STATUS_LABELS } from '@/lib/sdk/training/types'
export default function OverviewTab({
stats,
deadlines,
escalationResult,
onDismissEscalation,
}: {
stats: TrainingStats
deadlines: DeadlineInfo[]
escalationResult: { total_checked: number; escalated: number } | null
onDismissEscalation: () => void
}) {
return (
{escalationResult && (
Eskalationspruefung abgeschlossen
{escalationResult.total_checked} geprueft, {escalationResult.escalated} eskaliert
)}
{deadlines.length > 0 && (
Bevorstehende Fristen
{deadlines.map(d => {
const colors = STATUS_COLORS[d.status]
return (
{d.user_name}
{d.module_code} — {d.module_title}
{STATUS_LABELS[d.status]}
{d.days_left <= 0 ? 'Ueberfaellig' : `${d.days_left}d`}
)
})}
)}
)
}
function StatCard({ label, value, color }: { label: string; value: string | number; color: string }) {
const colorMap: Record = {
blue: 'text-blue-700',
green: 'text-green-700',
red: 'text-red-700',
yellow: 'text-yellow-700',
purple: 'text-purple-700',
gray: 'text-gray-700',
}
return (
)
}