"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.PageInfiniteScrollLoader = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _useCollectionReachBottom = require("./useCollectionReachBottom");
var _react = _interopRequireDefault(require("react"));
var _InfiniteScrollLoader = require("./InfiniteScrollLoader/InfiniteScrollLoader");
var _mobxReactLite = require("mobx-react-lite");
var _providers = require("../providers");
var _jsxFileName = "/home/builduser/work/db7ea24852bc3350/packages/cairo/dist/cjs/components/PageInfiniteScrollLoader.tsx";
function _PageInfiniteScrollLoader(props) {
  const {
    scrollMoreAlways,
    ...rest
  } = props;
  const {
    scrollableContentRef
  } = (0, _providers.useScrollableContentContext)();
  const {
    targetRef
  } = (0, _useCollectionReachBottom.useCollectionReachBottom)({
    collection: props.state,
    containerRef: scrollableContentRef,
    scrollMoreAlways
  });
  return /*#__PURE__*/_react.default.createElement(_InfiniteScrollLoader.InfiniteScrollLoader, (0, _extends2.default)({
    targetRef: targetRef
  }, rest, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 26,
      columnNumber: 10
    }
  }));
}
const PageInfiniteScrollLoader = exports.PageInfiniteScrollLoader = (0, _mobxReactLite.observer)(_PageInfiniteScrollLoader);
//# sourceMappingURL=PageInfiniteScrollLoader.js.map