diff --git a/frontend/app/flashcards/page.tsx b/frontend/app/flashcards/page.tsx index 4d8e2d7..21fcc98 100644 --- a/frontend/app/flashcards/page.tsx +++ b/frontend/app/flashcards/page.tsx @@ -9,15 +9,7 @@ import { useToast } from '@/components/Toast' // import { flashcardsService, type CardSet, type Flashcard } from '@/lib/services/flashcards' import { flashcardsService, type Flashcard } from '@/lib/services/flashcards' -// 暫時為了兼容性定義 CardSet 類型 -type CardSet = { - id: string; - name: string; - color: string; -} - -// 使用簡化的 Flashcard 類型 -type Flashcard = Flashcard +// 移除不需要的型別定義,直接使用 import 的 Flashcard 型別 import { useRouter } from 'next/navigation' function FlashcardsContent() { @@ -77,15 +69,7 @@ function FlashcardsContent() { const [showForm, setShowForm] = useState(false) const [editingCard, setEditingCard] = useState(null) - // 添加假資料用於展示CEFR效果 (更新為 Flashcard 格式) - const mockFlashcards: Flashcard[] = [ - { id: 'mock1', word: 'hello', translation: '你好', partOfSpeech: 'interjection', pronunciation: '/həˈloʊ/', masteryLevel: 95, timesReviewed: 15, isFavorite: true, nextReviewDate: '2025-09-21', difficultyLevel: 'A1', definition: 'A greeting word', example: 'Hello, how are you?', createdAt: '2025-09-17', updatedAt: '2025-09-17' }, - { id: 'mock2', word: 'beautiful', translation: '美麗的', partOfSpeech: 'adjective', pronunciation: '/ˈbjuːtɪfəl/', masteryLevel: 78, timesReviewed: 8, isFavorite: false, nextReviewDate: '2025-09-22', difficultyLevel: 'A2', definition: 'Pleasing to look at', example: 'The beautiful sunset', createdAt: '2025-09-16', updatedAt: '2025-09-16' }, - { id: 'mock3', word: 'understand', translation: '理解', partOfSpeech: 'verb', pronunciation: '/ˌʌndərˈstænd/', masteryLevel: 65, timesReviewed: 12, isFavorite: true, nextReviewDate: '2025-09-20', difficultyLevel: 'B1', definition: 'To comprehend', example: 'I understand the concept', createdAt: '2025-09-15', updatedAt: '2025-09-15' }, - { id: 'mock4', word: 'elaborate', translation: '詳細說明', partOfSpeech: 'verb', pronunciation: '/ɪˈlæbərət/', masteryLevel: 45, timesReviewed: 5, isFavorite: false, nextReviewDate: '2025-09-19', difficultyLevel: 'B2', definition: 'To explain in detail', example: 'Please elaborate on your idea', createdAt: '2025-09-14', updatedAt: '2025-09-14' }, - { id: 'mock5', word: 'sophisticated', translation: '精密的', partOfSpeech: 'adjective', pronunciation: '/səˈfɪstɪkeɪtɪd/', masteryLevel: 30, timesReviewed: 3, isFavorite: true, nextReviewDate: '2025-09-18', difficultyLevel: 'C1', definition: 'Highly developed', example: 'A sophisticated system', createdAt: '2025-09-13', updatedAt: '2025-09-13' }, - { id: 'mock6', word: 'ubiquitous', translation: '無處不在的', partOfSpeech: 'adjective', pronunciation: '/juːˈbɪkwɪtəs/', masteryLevel: 15, timesReviewed: 1, isFavorite: false, nextReviewDate: '2025-09-17', difficultyLevel: 'C2', definition: 'Present everywhere', example: 'Smartphones are ubiquitous', createdAt: '2025-09-12', updatedAt: '2025-09-12' } - ] + // 移除假資料,現在完全使用真實 API 資料 // 載入總數統計 const loadTotalCounts = async () => { @@ -233,7 +217,6 @@ function FlashcardsContent() { // 由於後端已處理篩選,直接使用 API 回傳的結果 - const allCards = [...flashcards, ...mockFlashcards] // 保留模擬資料用於展示 const filteredCards = flashcards // 直接使用從 API 取得的已篩選結果 // 清除所有篩選