import { useEffect, useState } from 'react'; import { fetchProgress } from '../api/lessons'; import type { ProgressSummary } from '../api/types'; import { PronunciationOverview } from '../components/PronunciationOverview'; import { ScoreBadge } from '../components/ScoreBadge'; export function ProgressPage() { const [progress, setProgress] = useState(null); const [error, setError] = useState(''); useEffect(() => { fetchProgress().then(setProgress).catch((err) => setError(err instanceof Error ? err.message : 'Fortschritt konnte nicht geladen werden')); }, []); if (error) return

{error}

; if (!progress) return

Lade Fortschritt...

; return (

Lernübersicht

Fortschritt

Versuche {progress.total_attempts}

Letzte Versuche

{(progress.recent_attempts ?? []).map((attempt) => (
{new Date(attempt.created_at).toLocaleString()} {Math.round(attempt.overall_score)}
))}
); }