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