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