import _extends from "@babel/runtime/helpers/extends";
import _Tooltip from "antd/es/tooltip";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["textValue", "tipColor", "defaultShow", "placement", "style", "mouseEnterDelay", "mouseLeaveDelay", "triggerMethod"];
import * as React from 'react';
import { useEffect } from 'react';
import "./index.less";
var antTooltip = function antTooltip(_ref) {
  var textValue = _ref.textValue,
    tipColor = _ref.tipColor,
    defaultShow = _ref.defaultShow,
    placement = _ref.placement,
    style = _ref.style,
    mouseEnterDelay = _ref.mouseEnterDelay,
    mouseLeaveDelay = _ref.mouseLeaveDelay,
    triggerMethod = _ref.triggerMethod,
    otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);
  console.log('otherProps', otherProps);
  var _style = style || {};
  _style['width'] = _style['width'];
  var _otherProps = otherProps || {};
  _otherProps.style = _style;
  useEffect(function () {
    content();
  });
  // 改变内容的颜色
  var content = function content() {
    var ele = document.querySelector('.my-ant-tooptip');
  };
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "my-ant-tooptip"
  }, _otherProps), defaultShow ? /*#__PURE__*/React.createElement(_Tooltip, {
    trigger: triggerMethod,
    mouseEnterDelay: mouseEnterDelay,
    mouseLeaveDelay: mouseLeaveDelay,
    title: textValue,
    placement: placement,
    color: tipColor,
    visible: defaultShow
  }, /*#__PURE__*/React.createElement("span", {
    className: "my-tooptip"
  }, textValue)) : /*#__PURE__*/React.createElement(_Tooltip, {
    trigger: triggerMethod,
    mouseEnterDelay: mouseEnterDelay,
    mouseLeaveDelay: mouseLeaveDelay,
    title: textValue,
    placement: placement,
    color: tipColor
  }, /*#__PURE__*/React.createElement("span", {
    className: "my-tooptip"
  }, textValue)));
};
antTooltip.displayName = 'antTooltip';
export default antTooltip;