import { useState } from 'react' import ReactMarkdown from 'react-markdown' import remarkGfm from 'remark-gfm' import { ListTodo, FileText, X, ExternalLink } from 'lucide-react' import { useStore } from '../store' const API = '/api' export function RightSidebar() { const { activeRoomId, tasks, workspace } = useStore() const [previewFile, setPreviewFile] = useState<{ name: string; content: string } | null>(null) const tasksMd = activeRoomId ? (tasks[activeRoomId] || '') : '' const files = activeRoomId ? (workspace[activeRoomId] || []) : [] const openFile = async (filename: string) => { if (!activeRoomId) return const d = await fetch(`${API}/rooms/${activeRoomId}/workspace/${filename}`).then(r => r.json()) setPreviewFile({ name: filename, content: d.content || '' }) } if (!activeRoomId) { return (
暂无任务
)}暂无修改的文件
)}