import "choerodon-ui/lib/tooltip/style";
import _Tooltip from "choerodon-ui/lib/tooltip";
import "choerodon-ui/lib/icon/style";
import _Icon from "choerodon-ui/lib/icon";

/* eslint-disable react/require-default-props */
import React, { useMemo } from 'react';
import { injectIntl } from 'react-intl';
import "./index.less";

function Tips(_ref) {
  var helpText = _ref.helpText,
      showHelp = _ref.showHelp,
      title = _ref.title,
      popoverClassName = _ref.popoverClassName,
      placement = _ref.placement,
      className = _ref.className;
  return title ? /*#__PURE__*/React.createElement("div", {
    className: "c7ncd-tips-wrap ".concat(className || '')
  }, title && /*#__PURE__*/React.createElement("span", null, title), showHelp && /*#__PURE__*/React.createElement(_Tooltip, {
    title: helpText,
    overlayClassName: "c7ncd-tips-popover ".concat(popoverClassName || ''),
    overlayStyle: {
      maxWidth: '3.5rem'
    },
    placement: placement,
    arrowPointAtCenter: true
  }, /*#__PURE__*/React.createElement(_Icon, {
    type: "help c7ncd-select-tips-icon-mr"
  }))) : /*#__PURE__*/React.createElement(_Tooltip, {
    title: helpText,
    overlayClassName: "c7ncd-tips-popover ".concat(popoverClassName || ''),
    placement: placement,
    arrowPointAtCenter: true
  }, /*#__PURE__*/React.createElement(_Icon, {
    type: "help c7ncd-select-tips-icon"
  }));
}

Tips.defaultProps = {
  showHelp: true,
  placement: 'topRight'
};
export default injectIntl(Tips);