"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.UserList = UserList;
var _reactNative = require("react-native");
var _collections = require("../../../../../hooks/collections");
var _UserItem = require("../UserItem");
var _components = require("../../../../../components");
var _styles = require("./styles");
function UserList() {
  const {
    styles
  } = (0, _styles.useStyles)();
  const {
    blockedUsers,
    loadMore,
    hasMore,
    isLoading,
    isLoadingFirstPage
  } = (0, _collections.useBlockedUsersCollection)({
    limit: 20
  });
  return /*#__PURE__*/React.createElement(_reactNative.FlatList, {
    data: blockedUsers,
    keyExtractor: item => item.userId,
    contentContainerStyle: styles.container,
    renderItem: ({
      item
    }) => /*#__PURE__*/React.createElement(_UserItem.UserItem, {
      user: item
    }),
    ListEmptyComponent: !isLoading && !isLoadingFirstPage ? /*#__PURE__*/React.createElement(_components.Empty, {
      heightPercent: 0.7
    }, /*#__PURE__*/React.createElement(_components.Empty.Content, {
      icon: "list",
      title: "Nothing here to see yet"
    })) : null,
    ListFooterComponent: isLoading || isLoadingFirstPage ? /*#__PURE__*/React.createElement(React.Fragment, null, Array.from({
      length: 3
    }).map((_, index) => /*#__PURE__*/React.createElement(_UserItem.UserItem.Skeleton, {
      key: index
    }))) : null,
    onEndReached: () => {
      hasMore && !isLoading && !isLoadingFirstPage ? () => loadMore === null || loadMore === void 0 ? void 0 : loadMore() : undefined;
    }
  });
}
//# sourceMappingURL=UserList.js.map