/** * DefaultToolViewer * * Default rendering for tools that don't have specialized viewers. */ import React from 'react'; import { type ItemStatus } from '../BaseItem'; import { CollapsibleOutputSection } from './CollapsibleOutputSection'; import { extractOutputText, renderInput, renderOutput } from './renderHelpers'; import type { LinkedToolItem } from '@renderer/types/groups'; interface DefaultToolViewerProps { linkedTool: LinkedToolItem; status: ItemStatus; } export const DefaultToolViewer: React.FC = ({ linkedTool, status }) => { const hasMeaningfulOutput = linkedTool.result && (() => { const text = extractOutputText(linkedTool.result.content).trim(); return text.length > 0 && text !== '[]' && text !== '{}'; })(); return ( <> {/* Input Section */}
Input
{renderInput(linkedTool.name, linkedTool.input)}
{/* Output Section — Collapsed by default */} {!linkedTool.isOrphaned && linkedTool.result && hasMeaningfulOutput && ( {renderOutput(linkedTool.result.content)} )} ); };