"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.PromptInputBody = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const react_1 = require("react");
const uikit_1 = require("@gravity-ui/uikit");
const cn_1 = require("../../../utils/cn.js");
require("./PromptInputBody.css");
const b = (0, cn_1.block)('prompt-input-body');
/**
 * PromptInputBody component displays the main input area
 * with textarea or custom content
 *
 * @param props - Component props
 * @returns React component
 */
exports.PromptInputBody = (0, react_1.forwardRef)((props, ref) => {
    const { value, placeholder, maxLength, minRows = 1, maxRows = 15, autoFocus = false, disabledInput = false, onChange, onKeyDown, children, className, inputClassName, 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 }));
    }
    // Render default textarea
    return ((0, jsx_runtime_1.jsx)("div", { className: b(null, className), "data-qa": qa, children: (0, jsx_runtime_1.jsx)(uikit_1.TextArea, { controlRef: ref, size: "l", value: value, placeholder: placeholder, minRows: minRows, maxRows: maxRows, autoFocus: autoFocus, disabled: disabledInput, onUpdate: onChange, onKeyDown: onKeyDown, view: "clear", className: b('textarea'), controlProps: {
                className: b('textarea-control', inputClassName),
                maxLength,
            } }) }));
});
exports.PromptInputBody.displayName = 'PromptInputBody';
//# sourceMappingURL=PromptInputBody.js.map
