import{d as h,b as f,r as p,j as i}from"./index-d2b25495.js";import{L as u}from"./Loader-1b927baf.js";import{L as S}from"./List-863f013e.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};
