import{f as i,j as a,d as b,r as f}from"./index-952e178b.js";import{C as p}from"./CircularProgress-3b605689.js";import{L as S}from"./Select-41d78585.js";const L=i(p)(({theme:l})=>({display:"block",margin:"20px auto"})),j=()=>a.jsx(L,{}),w=i(S)(({theme:l,...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:l,loading:t,params:e,fetchapi:c,list:r,keyExtractor:n,renderItem:d})=>{const m=b(),[x,g]=f.useState(null),h=o=>{if(!t){const{target:s}=o;Math.ceil(s.scrollTop+s.offsetHeight)>=s.scrollHeight-5&&e&&e.page<e.no_of_pages&&c&&m(c({...e,page:e.page+1}))}},u=o=>{n&&g(n(o))};return a.jsxs(w,{onScroll:h,styles:l,children:[r&&(r==null?void 0:r.map((o,s)=>d(o,s,x,u))),t&&a.jsx(j,{})]})};export{j as L,k as S};
