/** * SkillToolViewer * * Renders the Skill tool with its instructions in a code block viewer style. */ import React from 'react'; import { CodeBlockViewer } from '@renderer/components/chat/viewers'; import type { LinkedToolItem } from '@renderer/types/groups'; interface SkillToolViewerProps { linkedTool: LinkedToolItem; } export const SkillToolViewer: React.FC = ({ linkedTool }) => { const skillInstructions = linkedTool.skillInstructions; const skillName = (linkedTool.input.skill as string) || 'Unknown Skill'; const resultContent = linkedTool.result?.content; const resultText = typeof resultContent === 'string' ? resultContent : Array.isArray(resultContent) ? resultContent .map((item: unknown) => (typeof item === 'string' ? item : JSON.stringify(item))) .join('\n') : ''; return (
{/* Initial result */} {resultText && (
Result
{resultText}
)} {/* Skill instructions */} {skillInstructions && (
Skill Instructions
)}
); };