'use client' import { useState } from 'react' import Link from 'next/link' export default function GeneratePage() { const [mode, setMode] = useState<'text' | 'theme'>('text') const [textInput, setTextInput] = useState('') const [selectedTheme, setSelectedTheme] = useState('') const [difficulty, setDifficulty] = useState('intermediate') const [cardCount, setCardCount] = useState(10) const [isGenerating, setIsGenerating] = useState(false) const [generatedCards, setGeneratedCards] = useState([]) const [showPreview, setShowPreview] = useState(false) const themes = [ { id: 'daily', name: '日常對話', icon: '🗣️' }, { id: 'business', name: '商務英語', icon: '💼' }, { id: 'tv', name: '美劇經典', icon: '📺' }, { id: 'movie', name: '電影台詞', icon: '🎬' }, { id: 'academic', name: '學術英語', icon: '🎓' }, { id: 'travel', name: '旅遊英語', icon: '✈️' }, ] const mockGeneratedCards = [ { id: 1, word: 'negotiate', partOfSpeech: 'verb', pronunciation: '/nɪˈɡoʊʃieɪt/', translation: '協商、談判', definition: 'To discuss something with someone in order to reach an agreement', example: 'We need to negotiate a better deal with our suppliers.', exampleTranslation: '我們需要與供應商協商更好的交易。', difficulty: 'intermediate' }, { id: 2, word: 'perspective', partOfSpeech: 'noun', pronunciation: '/pərˈspektɪv/', translation: '觀點、看法', definition: 'A particular way of considering something', example: 'From my perspective, this is the best solution.', exampleTranslation: '從我的角度來看,這是最好的解決方案。', difficulty: 'intermediate' }, { id: 3, word: 'accomplish', partOfSpeech: 'verb', pronunciation: '/əˈkɒmplɪʃ/', translation: '完成、達成', definition: 'To finish something successfully or to achieve something', example: 'She accomplished her goal of running a marathon.', exampleTranslation: '她完成了跑馬拉松的目標。', difficulty: 'intermediate' } ] const handleGenerate = () => { setIsGenerating(true) // Simulate AI generation setTimeout(() => { setGeneratedCards(mockGeneratedCards) setShowPreview(true) setIsGenerating(false) }, 2000) } const handleSaveCards = () => { // Mock save action alert('詞卡已保存到您的卡組!') } return (
{/* Navigation */}
{!showPreview ? (

AI 智能生成詞卡

{/* Mode Selection */}

選擇生成模式

{/* Content Input */}
{mode === 'text' ? (

輸入文本內容