import { jsx } from 'react/jsx-runtime';
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';

var css_248z = "@charset \"UTF-8\";\n/**\n* @author linhd\n* @date 2021/11/1 20:28\n* @description 表单错误提示\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-helper-text {\n  font-family: -apple-system, BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;\n  font-size: 12px;\n  font-weight: 400;\n  padding-left: 12px;\n  line-height: 20px;\n  color: rgba(46, 55, 67, 0.7);\n}\n.paraui-v3-helper-text.paraui-v3-helper-text-error {\n  color: rgb(235, 96, 84);\n}";
styleInject(css_248z);

var HelperText = function HelperText(props) {
  var className = props.className,
    style = props.style,
    _props$error = props.error,
    error = _props$error === void 0 ? false : _props$error,
    _props$hideErrorDom = props.hideErrorDom,
    hideErrorDom = _props$hideErrorDom === void 0 ? false : _props$hideErrorDom,
    helperText = props.helperText;
  if (hideErrorDom === null) return null;
  // 不存在错误,且没有错误隐藏错误dom
  if (!error && hideErrorDom) return null;
  // 处理class
  var handClass = function handClass() {
    var str = "".concat($prefixCls, "-helper-text");
    if (className) str += ' ' + className;
    if (error) str += " ".concat($prefixCls, "-helper-text-error");
    return str;
  };
  return jsx("p", Object.assign({
    className: handClass(),
    style: style
  }, {
    children: helperText
  }));
};

export { HelperText as default };
