/** Fallback renderer for tools without a dedicated view. */
import type { ReactNode } from "react";
import { Output, ResultImages, ResultText } from "./parts";
import type { ToolRenderer, ToolRenderProps } from "./types";
import { argsDigest } from "./util";
function Summary({ args }: ToolRenderProps): ReactNode {
return {argsDigest(args)};
}
function Body({ args, result }: ToolRenderProps): ReactNode {
let argText = "";
try {
argText = JSON.stringify(args, null, 2) ?? "";
} catch {
argText = String(args);
}
return (
<>
{argText && argText !== "{}" && (
)}
>
);
}
export const genericRenderer: ToolRenderer = { Summary, Body };