diff --git a/client/src/components/ToolResults.tsx b/client/src/components/ToolResults.tsx index 38d1d0382..d036298b9 100644 --- a/client/src/components/ToolResults.tsx +++ b/client/src/components/ToolResults.tsx @@ -22,17 +22,14 @@ const checkContentCompatibility = ( text?: string; [key: string]: unknown; }>, -): { isCompatible: boolean; message: string } => { +): { hasMatch: boolean; message: string } | null => { // Look for at least one text content block that matches the structured content const textBlocks = unstructuredContent.filter( (block) => block.type === "text", ); if (textBlocks.length === 0) { - return { - isCompatible: false, - message: "No text blocks to match structured content", - }; + return null; } // Check if any text block contains JSON that matches the structured content @@ -49,7 +46,7 @@ const checkContentCompatibility = ( if (isEqual) { return { - isCompatible: true, + hasMatch: true, message: `Structured content matches text block${textBlocks.length > 1 ? " (multiple blocks)" : ""}${unstructuredContent.length > textBlocks.length ? " + other content" : ""}`, }; } @@ -59,10 +56,7 @@ const checkContentCompatibility = ( } } - return { - isCompatible: false, - message: "No text block matches structured content", - }; + return null; }; const ToolResults = ({ @@ -195,16 +189,9 @@ const ToolResults = ({
Unstructured Content:
- {compatibilityResult && ( -
- {compatibilityResult.isCompatible ? "✓" : "⚠"}{" "} - {compatibilityResult.message} + {compatibilityResult?.hasMatch && ( +
+ ✓ {compatibilityResult.message}
)}