import { useCollectionReachBottom } from './useCollectionReachBottom'; import React from 'react'; import { InfiniteScrollLoader } from './InfiniteScrollLoader/InfiniteScrollLoader'; import { CollectionState, FiltersMap } from '@wix/bex-core'; import { observer } from 'mobx-react-lite'; import { useScrollableContentContext } from '../providers'; export interface PageInfiniteScrollLoaderProps { dataHook?: string; state: CollectionState; scrollMoreAlways?: boolean; } function _PageInfiniteScrollLoader( props: PageInfiniteScrollLoaderProps, ) { const { scrollMoreAlways, ...rest } = props; const { scrollableContentRef } = useScrollableContentContext(); const { targetRef } = useCollectionReachBottom({ collection: props.state, containerRef: scrollableContentRef, scrollMoreAlways, }); return ; } export const PageInfiniteScrollLoader = observer(_PageInfiniteScrollLoader);