UNPKG

@botonic/react

Version:

Build Chatbots using React

21 lines 1.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ExecutedTools = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const styled_components_1 = tslib_1.__importDefault(require("styled-components")); const icons_1 = require("../../icons"); const styles_1 = require("../../styles"); const constants_1 = require("../constants"); const StyledSeeToolDetailsButton = (0, styled_components_1.default)(styles_1.StyledSeeInfo) ` flex-shrink: 0; border: none; `; const ExecutedTools = ({ tools, onSeeToolDetails }) => { if (!tools.length) { return null; } return ((0, jsx_runtime_1.jsxs)(styles_1.StyledDebugDetail, { children: [(0, jsx_runtime_1.jsx)(styles_1.StyledDebugLabel, { children: constants_1.LABELS.EXECUTED_TOOLS }), tools.map((tool, index) => ((0, jsx_runtime_1.jsxs)(styles_1.StyledDebugItemWithIcon, { children: [(0, jsx_runtime_1.jsx)(icons_1.ScrewdriverWrenchSvg, {}), tool.tool_name, (0, jsx_runtime_1.jsx)(StyledSeeToolDetailsButton, { onClick: () => onSeeToolDetails(tool), children: constants_1.LABELS.SEE_TOOL_DETAILS })] }, `${tool.tool_name}-${index}`)))] })); }; exports.ExecutedTools = ExecutedTools; //# sourceMappingURL=executed-tools.js.map