"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PromptInputHeader = PromptInputHeader;
const jsx_runtime_1 = require("react/jsx-runtime");
const cn_1 = require("../../../utils/cn.js");
const ContextIndicator_1 = require("../../atoms/ContextIndicator/index.js");
const ContextItem_1 = require("../../atoms/ContextItem/index.js");
require("./PromptInputHeader.css");
const b = (0, cn_1.block)('prompt-input-header');
/**
 * PromptInputHeader component displays the header section of prompt input
 * with optional context items on the left, context indicator on the right, or custom content
 *
 * @param props - Component props
 * @returns React component
 */
function PromptInputHeader(props) {
    const { contextItems = [], showContextIndicator = false, contextIndicatorProps, children, className, qa, } = props;
    // If custom content is provided, render it
    if (children) {
        return ((0, jsx_runtime_1.jsx)("div", { className: b(null, className), "data-qa": qa, children: children }));
    }
    // Check if we have anything to display
    const hasContextItems = contextItems.length > 0;
    const hasContextIndicator = showContextIndicator && contextIndicatorProps;
    const shouldRender = hasContextItems || hasContextIndicator;
    if (!shouldRender) {
        return null;
    }
    return ((0, jsx_runtime_1.jsxs)("div", { className: b(null, className), "data-qa": qa, children: [hasContextItems && ((0, jsx_runtime_1.jsx)("div", { className: b('context-items'), children: contextItems.map((item) => ((0, jsx_runtime_1.jsx)(ContextItem_1.ContextItem, { content: item.content, onClick: item.onRemove, qa: `${qa}-context-item-${item.id}` }, item.id))) })), hasContextIndicator && ((0, jsx_runtime_1.jsx)("div", { className: b('context-indicator'), children: (0, jsx_runtime_1.jsx)(ContextIndicator_1.ContextIndicator, Object.assign({}, contextIndicatorProps)) }))] }));
}
//# sourceMappingURL=PromptInputHeader.js.map
