import{r as o,j as r,F as v,a as b}from"./react.b0bedc10.js";import{d as j}from"./zarm.80120c4d.js";import{s as w}from"./searchEmpty.9ddd526b.js";const e={normal:0,abort:1,loading:2,success:3,failure:4,complete:5},I=w,D=c=>{const{data:a,renderItem:d,loadFetch:h,refId:m,styles:p}=c,[u,t]=o.exports.useState(e.normal),[l,f]=o.exports.useState(2),g=o.exports.useRef(),x=()=>{t(e.loading),h(l).then(({success:s,total:n})=>{if(a.length>=n)return t(e.complete);s===!0?(f(l+1),t(e.success)):t(e.failure)})};o.exports.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="auto"}),[]);const y={overflowY:"auto",height:"100vh",...p};return r(v,{children:b(j,{ref:g,style:y,stayTime:1e3,startDistance:50,load:{state:u,distance:200,handler:x},children:[a.length===0&&r("div",{style:{height:"80vh",display:"flex",justifyContent:"center",alignItems:"center"},children:r("img",{style:{width:200,height:200},src:I,alt:""})}),a.map((s,n)=>{var i;return r("div",{style:{border:"1px solid #ccc",height:"auto",fontSize:16,margin:"10px 16px",padding:"10px 16px"},children:d(s)},(i=s[m])!=null?i:n)})]})})};export{D as C};
