import { useState, useEffect } from 'react'
import { User, Bot, Wrench, CheckCircle, AlertCircle, Terminal, File, Image, FileText, Music, Video, Download, ChevronDown, ChevronRight, Copy, Check, Loader2, XCircle, Clock, Loader, X, Brain, Maximize2 } from 'lucide-react'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import type { ChatMessage, Attachment, TaskToolResult } from '../../types/protocol'
import { ToolDetailModal } from './ToolDetailModal'
// 状态图标组件
function StatusIcon({ status, size = 14 }: { status: 'calling' | 'result' | 'pending' | 'success' | 'failed' | 'timeout', size?: number }) {
const iconClass = `transition-all duration-300`
switch (status) {
case 'calling':
return (
{taskPrompt}
{JSON.stringify(message.arguments, null, 2)}
{formatJSON(displayContent)}
{children}
)
},
// 标题样式
h1: ({ children }) => (
{children}
, // 列表 ul: ({ children }) =>{children}), // 分隔线 hr: () =>