import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { TextArea } from '@gravity-ui/uikit';
import { block } from "../../../utils/cn.js";
import "./PromptInputBody.css";
const b = block('prompt-input-body');
/**
 * PromptInputBody component displays the main input area
 * with textarea or custom content
 *
 * @param props - Component props
 * @returns React component
 */
export const PromptInputBody = 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 (_jsx("div", { className: b(null, className), "data-qa": qa, children: children }));
    }
    // Render default textarea
    return (_jsx("div", { className: b(null, className), "data-qa": qa, children: _jsx(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,
            } }) }));
});
PromptInputBody.displayName = 'PromptInputBody';
//# sourceMappingURL=PromptInputBody.js.map
