import type { JSX } from "react"; import { translate } from "../../../../i18n/index"; import { ToolMarkdownBlock, ToolSection, type AgentToolRendererProps } from "./agentToolContentShared"; import { getToolSearchRenderData } from "./render-data/agentToolRenderData"; export function AgentToolSearchContent({ call }: AgentToolRendererProps): JSX.Element | null { "use memo"; const toolSearch = getToolSearchRenderData(call); if (!toolSearch.query && toolSearch.matches.length === 0) { return null; } return (
{toolSearch.displayQuery ? ( ) : null} {toolSearch.matches.length > 0 ? (
{toolSearch.matches.map((match, index) => (
0 ? "border-t border-[var(--line-2)]" : "" }`} > {match}
))}
) : null} {toolSearch.matches.length === 0 ? (
{translate("agentHost.agentTool.details.noMatchingTools")}
) : null} {typeof toolSearch.totalDeferredTools === "number" ? (
{translate("agentHost.agentTool.details.loadedAvailable", { loaded: toolSearch.matches.length, available: toolSearch.totalDeferredTools })}
) : null}
); }