"use strict";

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