fix: 修復卡片右上角CEFR顯示空白問題

- 移除ExtendedFlashcard接口中冗余的difficulty屬性
- 所有CEFR顯示統一使用difficultyLevel屬性
- 確保卡片右上角正確顯示CEFR等級 (A1, A2, B1, etc.)
- 完善接口註釋,避免屬性混淆

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
鄭沛軒 2025-09-25 22:30:37 +08:00
parent 1987643f6d
commit 639f620948
1 changed files with 11 additions and 11 deletions

View File

@ -13,17 +13,17 @@ import { calculateCurrentMastery, getReviewTypesByDifficulty } from '@/lib/utils
// 擴展的Flashcard接口包含智能複習需要的欄位
interface ExtendedFlashcard extends Omit<Flashcard, 'nextReviewDate'> {
userLevel?: number; // 學習者程度 (1-100)
wordLevel?: number; // 詞彙難度 (1-100)
userLevel?: number; // 學習者程度 (1-100) - 向後兼容
wordLevel?: number; // 詞彙難度 (1-100) - 向後兼容
nextReviewDate?: string; // 下次復習日期 (可選)
currentInterval?: number; // 當前間隔天數
isOverdue?: boolean; // 是否逾期
overdueDays?: number; // 逾期天數
baseMasteryLevel?: number; // 基礎熟悉度
lastReviewDate?: string; // 最後復習日期
synonyms?: string[]; // 同義詞 (暫時保留mock格式)
difficulty?: string; // CEFR等級 (暫時保留mock格式)
exampleImage?: string; // 例句圖片 (暫時保留mock格式)
synonyms?: string[]; // 同義詞 (向後兼容)
exampleImage?: string; // 例句圖片 (向後兼容)
// 注意difficultyLevel已在基礎Flashcard接口中定義
}
export default function LearnPage() {
@ -1042,7 +1042,7 @@ export default function LearnPage() {
</h2>
<span className="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">
{currentCard.difficulty}
{currentCard.difficultyLevel}
</span>
</div>
@ -1155,7 +1155,7 @@ export default function LearnPage() {
</h2>
<span className="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">
{currentCard.difficulty}
{currentCard.difficultyLevel}
</span>
</div>
@ -1324,7 +1324,7 @@ export default function LearnPage() {
()
</h2>
<span className="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">
{currentCard.difficulty}
{currentCard.difficultyLevel}
</span>
</div>
@ -1435,7 +1435,7 @@ export default function LearnPage() {
</h2>
<span className="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">
{currentCard.difficulty}
{currentCard.difficultyLevel}
</span>
</div>
@ -1504,7 +1504,7 @@ export default function LearnPage() {
</h2>
<span className="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">
{currentCard.difficulty}
{currentCard.difficultyLevel}
</span>
</div>
@ -1613,7 +1613,7 @@ export default function LearnPage() {
</h2>
<span className="bg-blue-100 text-blue-800 text-xs px-2 py-1 rounded-full">
{currentCard.difficulty}
{currentCard.difficultyLevel}
</span>
</div>