diff --git a/packages/web/src/components/tool-call-item.tsx b/packages/web/src/components/tool-call-item.tsx index 4a1a8171b..beab5a943 100644 --- a/packages/web/src/components/tool-call-item.tsx +++ b/packages/web/src/components/tool-call-item.tsx @@ -23,6 +23,11 @@ interface ToolCallItemProps { showTime?: boolean; } +//Registry +const TOOL_RENDERERS: Record> = { + "slack-notify": SlackNotifyEvent, +}; + function ToolIcon({ name }: { name: string | null }) { if (!name) return null; @@ -51,14 +56,11 @@ function ToolIcon({ name }: { name: string | null }) { } export function ToolCallItem({ event, isExpanded, onToggle, showTime = true }: ToolCallItemProps) { - if (event.tool === "slack-notify") { + const Renderer = TOOL_RENDERERS[event.tool]; + + if (Renderer) { return ( - + ); }