import { jsx as _jsx } from "react/jsx-runtime";
import { PromptInputFull } from "./PromptInputFull.js";
import { PromptInputSimple } from "./PromptInputSimple.js";
import { PromptInputWithPanels } from "./PromptInputWithPanels.js";
import { PromptInputWithSuggestions } from "./PromptInputWithSuggestions.js";
import { usePromptInput } from "./usePromptInput.js";
import "./PromptInput.css";
/**
 * PromptInput component - a flexible input component for chat interfaces
 * with support for simple and full views, attachments, suggestions, and expandable panels
 *
 * @param props - Component props
 * @returns React component
 */
export function PromptInput(props) {
    const { view = 'simple', onSend, onCancel, initialValue, disabled = false, status = 'ready', maxLength, headerProps, bodyProps, footerProps, suggestionsProps, topPanel, bottomPanel, className, qa, } = props;
    const hookState = usePromptInput({
        onSend,
        onCancel,
        initialValue,
        disabled,
        status,
        maxLength,
    });
    // Handle suggestion click with custom handler or default to input change
    const handleSuggestionClick = (suggestion) => {
        if (suggestionsProps === null || suggestionsProps === void 0 ? void 0 : suggestionsProps.onSuggestionClick) {
            suggestionsProps.onSuggestionClick(suggestion);
        }
        else {
            hookState.handleChange(suggestion);
        }
    };
    const isFullView = view === 'full';
    // Prepare suggestions props with wrapped handler
    const wrappedSuggestionsProps = suggestionsProps
        ? Object.assign(Object.assign({}, suggestionsProps), { onSuggestionClick: handleSuggestionClick }) : undefined;
    return (_jsx(PromptInputWithSuggestions, { suggestionsProps: wrappedSuggestionsProps, children: _jsx(PromptInputWithPanels, { topPanel: topPanel, bottomPanel: bottomPanel, children: isFullView ? (_jsx(PromptInputFull, { hookState: hookState, headerProps: headerProps, bodyProps: bodyProps, footerProps: footerProps, className: className, qa: qa })) : (_jsx(PromptInputSimple, { hookState: hookState, bodyProps: bodyProps, footerProps: footerProps, className: className, qa: qa })) }) }));
}
//# sourceMappingURL=PromptInput.js.map
