'use client' import { useState } from 'react' import { ArrowLeft, ArrowRight, Check, Plus, Settings2, Users, MessageCircle, Sparkles, } from 'lucide-react' import { FeaturePage, PageHeader, pageActionClass } from '@/components/layout/FeaturePage' import { LearningShell } from '@/components/learning/LearningShell' import { LearningCardContent } from '@/components/learning/LearningCard' import PartnerAvatar from '@/components/partners/PartnerAvatar' import { Dialog } from '@/shared/ui/Dialog' import MarkdownRenderer from '@/components/common/MarkdownRenderer' import { MasteryQuestionCard } from '@/components/chat/home/MasteryQuestionCard' import type { MasteryGradeResult } from '@/lib/mastery-question' import { DASHBOARD_GROUPS } from '@/components/space/dashboard-groups' import { learningKinds, type Collections, type LearningKind, type LearningRecord, } from './collections' import { question } from './fixtures' import { readDemo, writeDemo } from './demo-transport' export function LearningOverview({ collections, onOpen, }: { collections: Collections onOpen: (r: LearningRecord) => void }) { const [kind, setKind] = useState('all') return ( {[{ id: 'all', label: '全部' }, ...learningKinds].map(k => ( ))} } >
{collections.learning .filter(r => kind === 'all' || r.kind === kind) .map(r => { const type = learningKinds.find(k => k.id === r.kind)! return ( ) })}
) } export function CreateLearningPage({ onBack, onCreate, }: { onBack: () => void onCreate: (r: LearningRecord) => void }) { const [kind, setKind] = useState('book') const [title, setTitle] = useState('') const [goal, setGoal] = useState('') return (
{ e.preventDefault() if (!title.trim()) return onCreate({ id: crypto.randomUUID(), title: title.trim(), kind, detail: '刚刚创建 · 草稿', notes: goal, }) setTitle('') setGoal('') }} >
{learningKinds.map(k => ( ))}