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