import cx from 'classnames';
import React, { Fragment } from 'react';
import { Colgroup } from './colgroup';
import { Classes } from './styles';
var DefaultEmptyContent = /*#__PURE__*/React.memo(function () {
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("img", {
    alt: "empty-image",
    className: "empty-image",
    src: "//img.alicdn.com/tfs/TB1l1LcM3HqK1RjSZJnXXbNLpXa-50-50.svg"
  }), /*#__PURE__*/React.createElement("div", {
    className: "empty-tips"
  }, "\u6CA1\u6709\u7B26\u5408\u67E5\u8BE2\u6761\u4EF6\u7684\u6570\u636E", /*#__PURE__*/React.createElement("br", null), "\u8BF7\u4FEE\u6539\u6761\u4EF6\u540E\u91CD\u65B0\u67E5\u8BE2"));
});
export function EmptyHtmlTable(_ref) {
  var descriptors = _ref.descriptors,
    isLoading = _ref.isLoading,
    emptyCellHeight = _ref.emptyCellHeight,
    _ref$EmptyContent = _ref.EmptyContent,
    EmptyContent = _ref$EmptyContent === void 0 ? DefaultEmptyContent : _ref$EmptyContent;
  var show = !isLoading;
  return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("table", {
    key: "table"
  }, /*#__PURE__*/React.createElement(Colgroup, {
    descriptors: descriptors
  }), /*#__PURE__*/React.createElement("tbody", null, /*#__PURE__*/React.createElement("tr", {
    className: cx(Classes.tableRow, Classes.first, Classes.last, 'no-hover'),
    "data-rowindex": 0
  }, /*#__PURE__*/React.createElement("td", {
    className: cx(Classes.tableCell, Classes.first, Classes.last),
    colSpan: descriptors.length,
    style: {
      height: emptyCellHeight !== null && emptyCellHeight !== void 0 ? emptyCellHeight : 200
    }
  })))), show && (/*#__PURE__*/React.createElement("div", {
    className: Classes.emptyWrapper,
    key: "empty"
  }, /*#__PURE__*/React.createElement(EmptyContent, null))));
}