({ block, toolResults, isStreaming, streamingDuration, toolCallDurations, cwd, onOpenFile, sessionId, entryId, blockIndex }: { block: AssistantContentBlock; toolResults?: Map<string, ToolResultMessage>; isStreaming?: boolean; streamingDuration?: number; toolCallDurations?: Map<string, number>; cwd?: string; onOpenFile?: (filePath: string) => void; sessionId?: string; entryId?: string; blockIndex: number })
| 579 | } |
| 580 | |
| 581 | function BlockView({ block, toolResults, isStreaming, streamingDuration, toolCallDurations, cwd, onOpenFile, sessionId, entryId, blockIndex }: { block: AssistantContentBlock; toolResults?: Map<string, ToolResultMessage>; isStreaming?: boolean; streamingDuration?: number; toolCallDurations?: Map<string, number>; cwd?: string; onOpenFile?: (filePath: string) => void; sessionId?: string; entryId?: string; blockIndex: number }) { |
| 582 | if (block.type === "text") { |
| 583 | return <TextBlock block={block as TextContent} isStreaming={isStreaming} cwd={cwd} onOpenFile={onOpenFile} />; |
| 584 | } |
| 585 | if (block.type === "thinking") { |
| 586 | return <ThinkingBlock block={block as ThinkingContent} duration={streamingDuration} sessionId={sessionId} entryId={entryId} blockIndex={blockIndex} />; |
| 587 | } |
| 588 | if (block.type === "toolCall") { |
| 589 | const tc = block as ToolCallContent; |
| 590 | const result = toolResults?.get(tc.toolCallId); |
| 591 | const duration = toolCallDurations?.get(tc.toolCallId); |
| 592 | return <ToolCallBlock block={tc} result={result} duration={duration} />; |
| 593 | } |
| 594 | return null; |
| 595 | } |
| 596 | |
| 597 | function TextBlock({ block, isStreaming, cwd, onOpenFile }: { block: TextContent; isStreaming?: boolean; cwd?: string; onOpenFile?: (filePath: string) => void }) { |
| 598 | return <MarkdownBody isStreaming={isStreaming} cwd={cwd} onOpenFile={onOpenFile}>{block.text}</MarkdownBody>; |
nothing calls this directly
no outgoing calls
no test coverage detected