import React from 'react' import type { Flashcard } from '@/lib/services/flashcards' import { getPartOfSpeechDisplay, getCEFRColor } from '@/lib/utils/flashcardUtils' import { BluePlayButton } from '@/components/shared/BluePlayButton' interface FlashcardDetailHeaderProps { flashcard: Flashcard isPlayingWord: boolean isPlayingExample: boolean onToggleWordTTS: (text: string, lang?: string) => void } export const FlashcardDetailHeader: React.FC = ({ flashcard, isPlayingWord, isPlayingExample, onToggleWordTTS }) => { return (

{flashcard.word}

{getPartOfSpeechDisplay(flashcard.partOfSpeech)} {flashcard.pronunciation} {/* TTS播放按鈕 - 使用統一的藍底漸層組件 */}
{/* 學習統計 */}
{flashcard.masteryLevel || 0}%
掌握程度
{flashcard.timesReviewed || 0}
複習次數
{(() => { if (!flashcard.nextReviewDate) return 0 const reviewDate = new Date(flashcard.nextReviewDate) if (isNaN(reviewDate.getTime())) return 0 const days = Math.ceil((reviewDate.getTime() - new Date().getTime()) / (1000 * 60 * 60 * 24)) return Math.max(0, days) })()}
天後複習
) }