import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { block } from "../../../utils/cn.js";
import { ContextIndicator } from "../../atoms/ContextIndicator/index.js";
import { ContextItem } from "../../atoms/ContextItem/index.js";
import "./PromptInputHeader.css";
const b = 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
 */
export function PromptInputHeader(props) {
    const { contextItems = [], showContextIndicator = false, contextIndicatorProps, children, className, qa, } = props;
    // If custom content is provided, render it
    if (children) {
        return (_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 (_jsxs("div", { className: b(null, className), "data-qa": qa, children: [hasContextItems && (_jsx("div", { className: b('context-items'), children: contextItems.map((item) => (_jsx(ContextItem, { content: item.content, onClick: item.onRemove, qa: `${qa}-context-item-${item.id}` }, item.id))) })), hasContextIndicator && (_jsx("div", { className: b('context-indicator'), children: _jsx(ContextIndicator, Object.assign({}, contextIndicatorProps)) }))] }));
}
//# sourceMappingURL=PromptInputHeader.js.map
