import React, { memo } from 'react' import AudioPlayer from '@/components/AudioPlayer' interface TestResultDisplayProps { isCorrect: boolean correctAnswer: string userAnswer?: string word: string pronunciation?: string example: string exampleTranslation: string showResult: boolean } export const TestResultDisplay = memo(({ isCorrect, correctAnswer, userAnswer, word, pronunciation, example, exampleTranslation, showResult }) => { if (!showResult) return null return (

{isCorrect ? '正確!' : '錯誤!'}

{!isCorrect && userAnswer && (

正確答案是:{correctAnswer}

)}

{word && {word}} {pronunciation && {pronunciation}}

{example}

{exampleTranslation}

) }) TestResultDisplay.displayName = 'TestResultDisplay'