import{d as h,b as f,r as p,j as i}from"./index-43bf7a1c.js";import{L as u}from"./Loader-aabe9ed3.js";import{L as S}from"./List-6fcc4821.js";const L=h(S)(({theme:a,...t})=>{var e;return{maxHeight:(e=t==null?void 0:t.styles)==null?void 0:e.maxHeight,marginTop:"0px",overflowY:"auto",padding:"0 8px","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:a.palette.primary.main,borderRadius:"8px"},...t.styles}}),y=({styles:a,loading:t,params:e,fetchapi:r,list:l,keyExtractor:c,renderItem:n})=>{const d=f(),[m,g]=p.useState(null),x=o=>{if(!t){const{target:s}=o;Math.ceil(s.scrollTop+s.offsetHeight)==s.scrollHeight&&e&&e.page<e.no_of_pages&&r&&d(r({...e,page:e.page+1}))}},b=o=>{c&&g(c(o))};return i.jsxs(L,{onScroll:x,styles:a,children:[l&&(l==null?void 0:l.map((o,s)=>n(o,s,m,b))),t&&i.jsx(u,{})]})};export{y as S};
