fix: 修復新複習頁面的 TypeScript 類型錯誤

- 在 CardState interface 中添加 difficultyLevelNumeric 屬性
- 確保與 reviewSimpleData 中的類型定義兼容
- 修復 QuizProgress 組件的類型匹配問題
- /review 頁面現在能正常編譯和運行

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
鄭沛軒 2025-10-07 01:07:49 +08:00
parent a8562c3d48
commit c3dafee6c3
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,7 @@ interface CardState extends Flashcard {
isCompleted: boolean isCompleted: boolean
originalOrder: number originalOrder: number
synonyms?: string[] synonyms?: string[]
difficultyLevelNumeric: number // 添加缺少的屬性
} }
interface QuizItem { interface QuizItem {
@ -96,7 +97,8 @@ const generateQuizItemsFromFlashcards = (flashcards: Flashcard[]): QuizItem[] =>
wrongCount: 0, wrongCount: 0,
isCompleted: false, isCompleted: false,
originalOrder: order / 2, // 原始詞卡的順序 originalOrder: order / 2, // 原始詞卡的順序
synonyms: [] synonyms: [],
difficultyLevelNumeric: card.masteryLevel || 1 // 添加缺少的屬性
} }
// 為每張詞卡生成兩種測驗模式 // 為每張詞卡生成兩種測驗模式