"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.usePendingFollowRequests = usePendingFollowRequests;
var _collections = require("../../../../hooks/collections");
var _objects = require("../../../../hooks/objects");
var _useAuth = _interopRequireDefault(require("../../../../../core/hooks/useAuth"));
var _enums = require("../../../../enums");
var _hooks = require("../../../../hooks");
var _styles = require("../styles");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
function usePendingFollowRequests() {
  const {
    client
  } = (0, _useAuth.default)();
  const {
    styles
  } = (0, _styles.useStyles)();
  const {
    accessibilityId
  } = (0, _hooks.useAmityPage)({
    pageId: _enums.PageID.user_pending_follow_request_page
  });
  const {
    followInfo
  } = (0, _objects.useFollowInfo)({
    userId: (client === null || client === void 0 ? void 0 : client.userId) ?? '',
    enabled: !!(client !== null && client !== void 0 && client.userId)
  });
  const {
    hasMore,
    loadMore,
    isLoading,
    isLoadingFirstPage,
    followers: pendingRequests
  } = (0, _collections.useFollowerCollection)({
    userId: (client === null || client === void 0 ? void 0 : client.userId) ?? '',
    status: 'pending',
    limit: 20
  });
  return {
    pendingRequests,
    pendingCount: (followInfo === null || followInfo === void 0 ? void 0 : followInfo.pendingCount) ?? 0,
    isLoading,
    isLoadingFirstPage,
    hasMore,
    loadMore,
    styles,
    accessibilityId
  };
}
//# sourceMappingURL=usePendingFollowRequests.js.map