import React, { useState } from "react"; import { LLMContent } from "../types"; interface BrowserResizeToolProps { toolInput?: unknown; // { width: number, height: number } isRunning?: boolean; toolResult?: LLMContent[]; hasError?: boolean; executionTime?: string; } function BrowserResizeTool({ toolInput, isRunning, toolResult, hasError, executionTime, }: BrowserResizeToolProps) { const [isExpanded, setIsExpanded] = useState(false); // Extract dimensions from toolInput const width = typeof toolInput === "object" && toolInput !== null && "width" in toolInput && typeof (toolInput as { width: unknown }).width === "number" ? (toolInput as { width: number }).width : 0; const height = typeof toolInput === "object" && toolInput !== null && "height" in toolInput && typeof (toolInput as { height: unknown }).height === "number" ? (toolInput as { height: number }).height : 0; // Extract output from toolResult const output = toolResult && toolResult.length > 0 && toolResult[0].Text ? toolResult[0].Text : ""; const isComplete = !isRunning && toolResult !== undefined; const displaySize = width > 0 && height > 0 ? `${width}×${height}` : "..."; return (
{output}