"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ToolMessage = ToolMessage;
const jsx_runtime_1 = require("react/jsx-runtime");
const uikit_1 = require("@gravity-ui/uikit");
const useToolMessage_1 = require("../../../hooks/useToolMessage.js");
const cn_1 = require("../../../utils/cn.js");
const ToolFooter_1 = require("../../molecules/ToolFooter/index.js");
const ToolHeader_1 = require("../../molecules/ToolHeader/index.js");
require("./ToolMessage.css");
const b = (0, cn_1.block)('tool-message');
function ToolMessage(props) {
    const { toolName, className, qa, bodyContent, status, toolIcon, headerContent } = props;
    const { isExpanded, headerActions, footerActions, footerContent, showLoader, isWaiting } = (0, useToolMessage_1.useToolMessage)(props);
    return ((0, jsx_runtime_1.jsx)(uikit_1.Card, { className: b({ waiting: isWaiting }, className), qa: qa, children: (0, jsx_runtime_1.jsxs)("div", { className: b('container'), children: [(0, jsx_runtime_1.jsx)(ToolHeader_1.ToolHeader, { toolName: toolName, actions: headerActions, toolIcon: toolIcon, content: headerContent, status: status }), bodyContent && isExpanded && (0, jsx_runtime_1.jsx)("div", { className: b('content'), children: bodyContent }), isWaiting && ((0, jsx_runtime_1.jsx)(ToolFooter_1.ToolFooter, { actions: footerActions, content: footerContent, showLoader: showLoader }))] }) }));
}
//# sourceMappingURL=index.js.map
