import { jsxs, jsx } from 'react/jsx-runtime';
import { FormItem, FormControl, FormMessage } from '../../form.mjs';
import { Textarea } from '../../textarea.mjs';
import AutoFormLabel from '../common/label.mjs';
import AutoFormTooltip from '../common/tooltip.mjs';

function AutoFormTextarea({
  label,
  isRequired,
  fieldConfigItem,
  fieldProps
}) {
  const { showLabel: _showLabel, ...fieldPropsWithoutShowLabel } = fieldProps;
  const showLabel = _showLabel === void 0 ? true : _showLabel;
  return /* @__PURE__ */ jsxs(FormItem, { children: [
    showLabel && /* @__PURE__ */ jsx(
      AutoFormLabel,
      {
        label: fieldConfigItem?.label || label,
        isRequired
      }
    ),
    /* @__PURE__ */ jsx(FormControl, { children: /* @__PURE__ */ jsx(Textarea, { ...fieldPropsWithoutShowLabel }) }),
    /* @__PURE__ */ jsx(AutoFormTooltip, { fieldConfigItem }),
    /* @__PURE__ */ jsx(FormMessage, {})
  ] });
}

export { AutoFormTextarea as default };
