"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PromptInputFooter = PromptInputFooter;
const jsx_runtime_1 = require("react/jsx-runtime");
const icons_1 = require("@gravity-ui/icons");
const uikit_1 = require("@gravity-ui/uikit");
const cn_1 = require("../../../utils/cn.js");
const ActionButton_1 = require("../../atoms/ActionButton/index.js");
const SubmitButton_1 = require("../../atoms/SubmitButton/index.js");
const ButtonGroup_1 = require("../ButtonGroup/index.js");
const i18n_1 = require("./i18n/index.js");
require("./PromptInputFooter.css");
const b = (0, cn_1.block)('prompt-input-footer');
/**
 * PromptInputFooter component displays the footer section with action icons
 * and submit button
 *
 * @param props - Component props
 * @returns React component
 */
function PromptInputFooter(props) {
    const { submitButton, showSettings = false, onSettingsClick, showAttachment = false, onAttachmentClick, attachmentContent, showMicrophone = false, onMicrophoneClick, children, className, buttonSize = 'm', qa, } = props;
    // Render custom content with submit button
    if (children) {
        return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), "data-qa": qa, children: [(0, jsx_runtime_1.jsx)("div", { className: b('content'), children: children }), (0, jsx_runtime_1.jsx)("div", { className: b('submit'), children: (0, jsx_runtime_1.jsx)(SubmitButton_1.SubmitButton, Object.assign({}, submitButton, { size: buttonSize })) })] }));
    }
    const renderAttachment = () => {
        if (attachmentContent)
            return attachmentContent;
        if (!showAttachment)
            return null;
        return ((0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { view: "flat", size: buttonSize, onClick: onAttachmentClick, className: b('action-button'), tooltipTitle: (0, i18n_1.i18n)('tooltip-attachment'), children: (0, jsx_runtime_1.jsx)(uikit_1.Icon, { data: icons_1.Paperclip, size: 16 }) }));
    };
    // Render default footer
    return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), "data-qa": qa, children: [(0, jsx_runtime_1.jsx)(ButtonGroup_1.ButtonGroup, { children: showSettings && ((0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { view: "flat", size: buttonSize, onClick: onSettingsClick, className: b('action-button'), tooltipTitle: (0, i18n_1.i18n)('tooltip-settings'), children: (0, jsx_runtime_1.jsx)(uikit_1.Icon, { data: icons_1.Sliders, size: 16 }) })) }), (0, jsx_runtime_1.jsxs)(ButtonGroup_1.ButtonGroup, { children: [renderAttachment(), showMicrophone && ((0, jsx_runtime_1.jsx)(ActionButton_1.ActionButton, { view: "flat", size: buttonSize, onClick: onMicrophoneClick, className: b('action-button'), tooltipTitle: (0, i18n_1.i18n)('tooltip-microphone'), children: (0, jsx_runtime_1.jsx)(uikit_1.Icon, { data: icons_1.Microphone, size: 16 }) })), (0, jsx_runtime_1.jsx)(SubmitButton_1.SubmitButton, Object.assign({}, submitButton, { size: buttonSize }))] })] }));
}
//# sourceMappingURL=PromptInputFooter.js.map
