import React, { useEffect } from 'react';
import { observer } from 'mobx-react-lite';
import EmptyPage from "../../../../components/empty-page";
import Loading from "../../../../components/loading";
import HostsItem from "./components/hostItem";
import { useHostConfigStore } from "../../stores";
import CardPagination from "./components/CardPagination";
var ContentList = observer(function () {
  var _useHostConfigStore = useHostConfigStore(),
      prefixCls = _useHostConfigStore.prefixCls,
      intlPrefix = _useHostConfigStore.intlPrefix,
      formatMessage = _useHostConfigStore.formatMessage,
      listDs = _useHostConfigStore.listDs;

  useEffect(function () {}, []);

  if (listDs.status === 'loading' || !listDs) {
    return /*#__PURE__*/React.createElement(Loading, {
      display: true
    });
  }

  if (listDs && !listDs.length) {
    // @ts-ignore
    return /*#__PURE__*/React.createElement(EmptyPage, {
      title: "\u6682\u65E0\u4E3B\u673A",
      describe: "\u9879\u76EE\u4E0B\u6682\u65E0\u4E3B\u673A\uFF0C\u8BF7\u521B\u5EFA"
    });
  }

  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "".concat(prefixCls, "-content-list")
  }, listDs.map(function (record) {
    return /*#__PURE__*/React.createElement(HostsItem, Object.assign({}, record.data, {
      record: record,
      listDs: listDs
    }));
  })), /*#__PURE__*/React.createElement(CardPagination, {
    className: "".concat(prefixCls, "-content-pagination"),
    dataSet: listDs
  }));
});
export default ContentList;