// @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt AGPL-3.0-or-later
// @source: https://gitlab.com/soapbox-pub/ditto/-/tree/f0a3877c
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{qi as t}from"./lucide-icons-BdRF0moN.js";import{t as n}from"./useInView-DAJQSIvc.js";var r=e(t(),1);function i({hasNextPage:e,isFetchingNextPage:t,fetchNextPage:i,pageCount:a,enabled:o=!0}){(0,r.useEffect)(()=>{o&&e&&!t&&a===1&&i()},[o,e,t,a,i]);let{ref:s,inView:c}=n({threshold:0,rootMargin:`400px`});return(0,r.useEffect)(()=>{c&&e&&!t&&i()},[c,e,t,i]),{scrollRef:s}}export{i as t};
// @license-end
