import React from 'react';

// 内库使用-start
import LocaleUtil from "./../../../utils/LocaleUtil";
import Loading from "./../../Loading";
// 内库使用-end

/* 测试使用-start
import { LocaleUtil, Loading } from 'seedsui-react'
测试使用-end */

// status: loading | noMore | [error|自定义错误信息]
var InfiniteScroll = function InfiniteScroll(_ref) {
  var status = _ref.status;
  function getStatusNode() {
    if (!status || typeof status !== 'string') return null;
    if (status === 'loading') {
      return /*#__PURE__*/React.createElement("div", {
        className: "list-infinitescroll-wrapper"
      }, /*#__PURE__*/React.createElement("div", {
        className: "list-infinitescroll-text"
      }, LocaleUtil.locale('加载中', 'SeedsUI_refreshing')), /*#__PURE__*/React.createElement("div", {
        className: "list-infinitescroll-icon"
      }, /*#__PURE__*/React.createElement(Loading.BallWave, null)));
    }
    if (status === 'noMore') {
      return /*#__PURE__*/React.createElement("div", {
        className: "list-infinitescroll-wrapper"
      }, /*#__PURE__*/React.createElement("div", {
        className: "list-infinitescroll-text"
      }, LocaleUtil.locale('没有更多了', 'SeedsUI_no_more_data')));
    }
    return /*#__PURE__*/React.createElement("div", {
      className: "list-infinitescroll-wrapper"
    }, /*#__PURE__*/React.createElement("div", {
      className: "list-infinitescroll-text"
    }, status === 'error' ? LocaleUtil.locale('获取数据失败，请稍后再试！', 'SeedsUI_query_data_error') : status));
  }
  return /*#__PURE__*/React.createElement("div", {
    className: "list-infinitescroll"
  }, getStatusNode());
};
export default InfiniteScroll;