import React from 'react' import Link from 'next/link' import { Flashcard } from '@/lib/services/flashcards' import { getPartOfSpeechDisplay, getCEFRColor, getMasteryColor, getMasteryText, formatNextReviewDate, getFlashcardImageUrl } from '@/lib/utils/flashcardUtils' interface FlashcardCardProps { flashcard: Flashcard onEdit: () => void onDelete: () => void onFavorite: () => void onImageGenerate: () => void isGenerating?: boolean generationProgress?: string } export const FlashcardCard: React.FC = ({ flashcard, onEdit, onDelete, onFavorite, onImageGenerate, isGenerating = false, generationProgress = '' }) => { const exampleImageUrl = getFlashcardImageUrl(flashcard) return (
{/* CEFR標籤 */}
{flashcard.cefr}
{/* 詞彙標題 */}

{flashcard.word}

{getPartOfSpeechDisplay(flashcard.partOfSpeech)} {flashcard.pronunciation}
{/* 翻譯和定義 */}

{flashcard.translation}

{flashcard.definition}

{/* 例句 */}

"{flashcard.example}"

{flashcard.exampleTranslation && (

"{flashcard.exampleTranslation}"

)}
{/* 例句圖片 */}
{exampleImageUrl ? (
{`${flashcard.word} {!isGenerating && ( )} {isGenerating && (

{generationProgress}

)}
) : (

尚無例句圖片

)}
{/* 學習統計 */}
{getMasteryText(flashcard.masteryLevel)}
{flashcard.masteryLevel}%
{flashcard.timesReviewed}
複習次數
{formatNextReviewDate(flashcard.nextReviewDate)}
下次複習
{/* 操作按鈕 */}
查看詳情
) }