import{f as g,j as r,d as p,r as n}from"./index-c5c88b67.js";import{C as b}from"./CircularProgress-13afa056.js";import{L as S}from"./Menu-e7d2b2ee.js";const H=g(b)(({theme:c})=>({display:"block",margin:"20px auto"})),L=()=>r.jsx(H,{}),j=g(S)(({theme:c,...e})=>{var t;return{maxHeight:(t=e==null?void 0:e.styles)==null?void 0:t.maxHeight,marginTop:"0px",overflowY:"auto",padding:"0 12px 0 8px","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#DED7DE",borderRadius:"8px"},...e.styles}}),E=({styles:c,loading:e,params:t,fetchapi:a,list:l,keyExtractor:i,renderItem:h})=>{const d=p(),[f,m]=n.useState(null);n.useEffect(()=>{console.log("loading value:",e)},[e]);const u=s=>{if(!e){const{target:o}=s;console.log("target:",o.scrollHeight),console.log("topscroll height:",Math.ceil(o.scrollTop+o.offsetHeight)),Math.ceil(o.scrollTop+o.offsetHeight)>=o.scrollHeight-5&&t&&t.page<t.no_of_pages&&a&&d(a({...t,page:t.page+1}))}},x=s=>{i&&m(i(s))};return r.jsxs(j,{onScroll:u,styles:c,children:[l&&(l==null?void 0:l.map((s,o)=>h(s,o,f,x))),e&&r.jsx(L,{})]})};export{L,E as S};
