showcase/shell-docs/src/content/snippets/shared/guides/default-tool-rendering.mdx
useDefaultRenderTool provides a catch-all renderer for any tool that doesn't have a specific useRenderToolCall defined. This is useful for:
import { useDefaultRenderTool } from "@copilotkit/react-core/v2"; // [!code highlight]
// ...
const YourMainContent = () => {
// ...
// [!code highlight:15]
useDefaultRenderTool({
render: ({ name, args, status, result }) => {
return (
<div style={{ color: "black" }}>
<span>
{status === "complete" ? "✓" : "⏳"}
{name}
</span>
{status === "complete" && result && (
<pre>{JSON.stringify(result, null, 2)}</pre>
)}
</div>
);
},
});
// ...
};