"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PromptInputWithPanels = PromptInputWithPanels;
const jsx_runtime_1 = require("react/jsx-runtime");
const cn_1 = require("../../../utils/cn.js");
const PromptInputPanel_1 = require("../../molecules/PromptInputPanel/index.js");
const useDelayedUnmount_1 = require("./useDelayedUnmount.js");
const b = (0, cn_1.block)('prompt-input');
/**
 * PromptInputWithPanels component - wrapper that shows expandable panels around the prompt input
 *
 * @param props - Component props
 * @returns React component
 */
function PromptInputWithPanels(props) {
    var _a, _b;
    const { children, topPanel, bottomPanel, className, qa } = props;
    // Use hook to delay unmounting for animation
    const shouldRenderTopPanel = (0, useDelayedUnmount_1.useDelayedUnmount)((_a = topPanel === null || topPanel === void 0 ? void 0 : topPanel.isOpen) !== null && _a !== void 0 ? _a : false, 300);
    const shouldRenderBottomPanel = (0, useDelayedUnmount_1.useDelayedUnmount)((_b = bottomPanel === null || bottomPanel === void 0 ? void 0 : bottomPanel.isOpen) !== null && _b !== void 0 ? _b : false, 300);
    return ((0, jsx_runtime_1.jsxs)("div", { className: b('panel-wrapper', className), "data-qa": qa, children: [topPanel && shouldRenderTopPanel && ((0, jsx_runtime_1.jsx)("div", { className: b('panel', { position: 'top', open: topPanel.isOpen }), children: (0, jsx_runtime_1.jsx)(PromptInputPanel_1.PromptInputPanel, { children: topPanel.children }) })), children, bottomPanel && shouldRenderBottomPanel && ((0, jsx_runtime_1.jsx)("div", { className: b('panel', { position: 'bottom', open: bottomPanel.isOpen }), children: (0, jsx_runtime_1.jsx)(PromptInputPanel_1.PromptInputPanel, { children: bottomPanel.children }) }))] }));
}
//# sourceMappingURL=PromptInputWithPanels.js.map
