feat: wire MCPAppRenderer into ChatPanel for MCP App tool results
This commit is contained in:
@@ -3,6 +3,7 @@ import type { KeyboardEvent } from 'react'
|
||||
import ReactMarkdown from 'react-markdown'
|
||||
import { IconSend } from '@tabler/icons-react'
|
||||
import { ToolCallCard } from './ToolCallCard'
|
||||
import { MCPAppRenderer } from './MCPAppRenderer'
|
||||
import type { ChatMessage } from '../hooks/useChat'
|
||||
|
||||
interface ChatPanelProps {
|
||||
@@ -61,9 +62,19 @@ export function ChatPanel({ messages, isStreaming, onSend, sessionId }: ChatPane
|
||||
{message.role === 'assistant' ? (
|
||||
<div>
|
||||
<ReactMarkdown>{message.content}</ReactMarkdown>
|
||||
{message.toolCalls?.map(tc => (
|
||||
<ToolCallCard key={tc.id} toolCall={tc} />
|
||||
))}
|
||||
{message.toolCalls?.map(tc =>
|
||||
tc._meta?.ui?.resourceUri ? (
|
||||
<MCPAppRenderer
|
||||
key={tc.id}
|
||||
resourceUri={tc._meta.ui.resourceUri}
|
||||
data={tc.structuredContent ?? {}}
|
||||
csp={tc._meta.ui.csp}
|
||||
onSendMessage={(content) => onSend(content)}
|
||||
/>
|
||||
) : (
|
||||
<ToolCallCard key={tc.id} toolCall={tc} />
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div>{message.content}</div>
|
||||
|
||||
Reference in New Issue
Block a user