rdesign/frontend/node_modules/@copilotkitnext/react/dist/components/chat/CopilotChatToolCallsView.mjs

21 lines
857 B
JavaScript

import { useRenderToolCall } from "../../hooks/use-render-tool-call.mjs";
import "../../hooks/index.mjs";
import React from "react";
import { Fragment, jsx } from "react/jsx-runtime";
//#region src/components/chat/CopilotChatToolCallsView.tsx
function CopilotChatToolCallsView({ message, messages = [] }) {
const renderToolCall = useRenderToolCall();
if (!message.toolCalls || message.toolCalls.length === 0) return null;
return /* @__PURE__ */ jsx(Fragment, { children: message.toolCalls.map((toolCall) => {
const toolMessage = messages.find((m) => m.role === "tool" && m.toolCallId === toolCall.id);
return /* @__PURE__ */ jsx(React.Fragment, { children: renderToolCall({
toolCall,
toolMessage
}) }, toolCall.id);
}) });
}
//#endregion
export { CopilotChatToolCallsView as default };
//# sourceMappingURL=CopilotChatToolCallsView.mjs.map