'use client' import { useState } from 'react' import { Navigation } from '@/components/Navigation' import { FlipMemoryTest, VocabChoiceTest, SentenceFillTest, SentenceReorderTest, VocabListeningTest, SentenceListeningTest, SentenceSpeakingTest } from '@/components/review/review-tests' export default function ReviewTestsPage() { const [logs, setLogs] = useState([]) const [activeTab, setActiveTab] = useState('FlipMemoryTest') // 測驗組件清單 const testComponents = [ { id: 'FlipMemoryTest', name: '翻卡記憶測試', color: 'bg-blue-50' }, { id: 'VocabChoiceTest', name: '詞彙選擇測試', color: 'bg-green-50' }, { id: 'SentenceFillTest', name: '句子填空測試', color: 'bg-yellow-50' }, { id: 'SentenceReorderTest', name: '句子重排測試', color: 'bg-purple-50' }, { id: 'VocabListeningTest', name: '詞彙聽力測試', color: 'bg-red-50' }, { id: 'SentenceListeningTest', name: '句子聽力測試', color: 'bg-indigo-50' }, { id: 'SentenceSpeakingTest', name: '句子口說測試', color: 'bg-pink-50' } ] // 添加日誌函數 const addLog = (message: string) => { const timestamp = new Date().toLocaleTimeString() setLogs(prev => [`[${activeTab}] [${timestamp}] ${message}`, ...prev.slice(0, 9)]) } // 模擬資料 const mockCardData = { word: "elaborate", definition: "To explain something in more detail; to develop or present a theory, policy, or system in further detail", example: "Could you elaborate on your proposal for the new marketing strategy?", exampleTranslation: "你能詳細說明一下你對新行銷策略的提案嗎?", pronunciation: "/ɪˈlæbərət/", synonyms: ["explain", "detail", "expand", "clarify"], difficultyLevel: "B2", exampleImage: "https://via.placeholder.com/400x200?text=Marketing+Strategy" } // 選項題選項 const vocabChoiceOptions = ["elaborate", "celebrate", "collaborate", "deliberate"] // 回調函數 const handleConfidenceSubmit = (level: number) => { addLog(`FlipMemoryTest: 信心等級 ${level}`) } const handleAnswer = (answer: string) => { addLog(`答案提交: ${answer}`) } const handleReportError = () => { addLog('回報錯誤') } const handleImageClick = (image: string) => { addLog(`圖片點擊: ${image}`) } return (
{/* 頁面標題 */}

Review 組件設計

所有 review-tests 組件的 UI 設計頁面

{/* Tab 導航 */}
{testComponents.map((component) => ( ))}
{/* 當前測驗組件展示 */}

{activeTab}

{testComponents.find(c => c.id === activeTab)?.name}

{/* 條件渲染當前選中的測驗組件 */} {activeTab === 'FlipMemoryTest' && ( )} {activeTab === 'VocabChoiceTest' && ( )} {activeTab === 'SentenceFillTest' && ( )} {activeTab === 'SentenceReorderTest' && ( )} {activeTab === 'VocabListeningTest' && ( )} {activeTab === 'SentenceListeningTest' && ( )} {activeTab === 'SentenceSpeakingTest' && ( )}
{/* 操作日誌區域 */}

操作日誌

{logs.length === 0 ? (

無操作記錄

) : ( logs.map((log, index) => (
{log}
)) )}
) }