'use client'; import { useRouter } from 'next/navigation'; interface LearningCompleteProps { score: { correct: number; total: number; }; mode: string; onRestart?: () => void; onBackToDashboard?: () => void; } export default function LearningComplete({ score, mode, onRestart, onBackToDashboard }: LearningCompleteProps) { const router = useRouter(); const percentage = score.total > 0 ? Math.round((score.correct / score.total) * 100) : 0; const getGradeEmoji = (percentage: number) => { if (percentage >= 90) return '🏆'; if (percentage >= 80) return '🎉'; if (percentage >= 70) return '👍'; if (percentage >= 60) return '😊'; return '💪'; }; const getGradeMessage = (percentage: number) => { if (percentage >= 90) return '太棒了!你是學習高手!'; if (percentage >= 80) return '做得很好!繼續保持!'; if (percentage >= 70) return '不錯的表現!'; if (percentage >= 60) return '還不錯,繼續努力!'; return '加油!多練習會更好的!'; }; const getModeDisplayName = (mode: string) => { switch (mode) { case 'flip': return '翻卡模式'; case 'quiz': return '選擇題模式'; case 'fill': return '填空題模式'; case 'listening': return '聽力測試模式'; case 'speaking': return '口說練習模式'; default: return '學習模式'; } }; return (