import { useState } from 'react'
import { User, Bot, Wrench, CheckCircle, AlertCircle, Terminal, File, Image, FileText, Music, Video, Download, ChevronDown, ChevronRight, Copy, Check } from 'lucide-react'
import ReactMarkdown from 'react-markdown'
import remarkGfm from 'remark-gfm'
import type { ChatMessage, Attachment, TaskToolResult } from '../../types/protocol'
interface MessageBubbleProps {
message: ChatMessage
onNavigateToSubAgent?: (taskId: string, description: string) => void
}
function getAttachmentIcon(mediaType: string) {
switch (mediaType) {
case 'image': return
{taskPrompt}
{JSON.stringify(message.arguments, null, 2)}
{formatJSON(displayContent)}
{children}
)
},
// 标题样式
h1: ({ children }) => (
{children}
, // 列表 ul: ({ children }) =>{children}), // 分隔线 hr: () =>