import { FlatList } from 'react-native';
import { useBlockedUsersCollection } from '../../../../../hooks/collections';
import { UserItem } from '../UserItem';
import { Empty } from '../../../../../components';
import { useStyles } from './styles';
export function UserList() {
  const {
    styles
  } = useStyles();
  const {
    blockedUsers,
    loadMore,
    hasMore,
    isLoading,
    isLoadingFirstPage
  } = useBlockedUsersCollection({
    limit: 20
  });
  return /*#__PURE__*/React.createElement(FlatList, {
    data: blockedUsers,
    keyExtractor: item => item.userId,
    contentContainerStyle: styles.container,
    renderItem: ({
      item
    }) => /*#__PURE__*/React.createElement(UserItem, {
      user: item
    }),
    ListEmptyComponent: !isLoading && !isLoadingFirstPage ? /*#__PURE__*/React.createElement(Empty, {
      heightPercent: 0.7
    }, /*#__PURE__*/React.createElement(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.Skeleton, {
      key: index
    }))) : null,
    onEndReached: () => {
      hasMore && !isLoading && !isLoadingFirstPage ? () => loadMore === null || loadMore === void 0 ? void 0 : loadMore() : undefined;
    }
  });
}
//# sourceMappingURL=UserList.js.map