"use client"; import { useEffect } from "react"; import { fireConfetti } from "./AppShell"; import { sfx } from "@/lib/sfx"; export function scoreMessage(pct: number) { if (pct === 100) return { emoji: "🏆", de: "Perfekt! Du bist bereit für die Prüfung!", ar: "ممتاز! أنت جاهز للامتحان!" }; if (pct >= 80) return { emoji: "🌟", de: "Sehr gut! Weiter so!", ar: "جيد جداً! استمر هكذا!" }; if (pct >= 60) return { emoji: "👍", de: "Bestanden! (60 % reichen in der Prüfung)", ar: "ناجح! (60% تكفي في الامتحان)" }; return { emoji: "💪", de: "Noch nicht ganz – versuch es noch einmal!", ar: "ليس بعد – حاول مرة أخرى!" }; } export default function ResultCard({ correct, total, xp, onRetry, children }: { correct: number; total: number; xp: number; onRetry?: () => void; children?: React.ReactNode }) { const pct = total ? Math.round((correct / total) * 100) : 0; const m = scoreMessage(pct); useEffect(() => { if (pct >= 80) { fireConfetti(); sfx.win(); } }, [pct]); return (