"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _components = require("@alicloudfe/components");

var _icon = _interopRequireDefault(require("@teamix/icon"));

var _utils = require("@teamix/utils");

var _react = _interopRequireDefault(require("react"));

require("./index.scss");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * 刷新
 */
var cls = (0, _utils.usePrefixCls)('teamix-pro-table-toolbar-icon');

var LayoutIcon = function LayoutIcon(props) {
  var actionRef = props.actionRef; // const [fullscreen, setFullscreen] = useState<boolean>(false);
  // // 销毁监听函数
  // useEffect(() => {
  //   return () => {
  //     actionRef.current?.off?.('refreshIcon');
  //   };
  // }, []);
  // // 监听全屏变化
  // actionRef.current?.on?.(
  //   (state: boolean) => {
  //     setFullscreen(state);
  //   },
  //   'fullScreenState',
  //   'refreshIcon',
  // );

  return /*#__PURE__*/_react.default.createElement(_components.Balloon.Tooltip, {
    trigger: /*#__PURE__*/_react.default.createElement(_components.Button, {
      iconSize: "small",
      className: cls(),
      onClick: function onClick() {
        var _actionRef$current, _actionRef$current$re;

        return (_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : (_actionRef$current$re = _actionRef$current.refresh) === null || _actionRef$current$re === void 0 ? void 0 : _actionRef$current$re.call(_actionRef$current);
      }
    }, /*#__PURE__*/_react.default.createElement(_icon.default, {
      size: "small",
      type: "refresh-line"
    })),
    align: "t"
  }, (0, _utils.getMessage)('refresh'));
};

var _default = LayoutIcon;
exports.default = _default;