import{b as f,i as j,r as n,j as a,R as l,C as v,I as y,d as m}from"./index-9600e7d5.js";import{I as N}from"./index.es-b07989b8.js";import{R as b}from"./index-cdc25db9.js";import{h as p}from"./handleErrorMessage-588dcd74.js";import{s as I}from"./setWebPageTitle-364a3db0.js";import{L as x}from"./index-707c4d2f.js";function C(){const h=f(),{t:i}=j();I(i("video"));const[r,d]=n.useState([]),[t,c]=n.useState(null);async function g(e,o){try{const s=await m.get("video-play",{params:{limit:e,page:o,status:!0}});s&&(d(s.data.data),c(s.data.meta.pagination))}catch(s){p(s)}}async function u(e,o){try{console.log("loading: ",o);const s=await m.get("video-play",{params:{limit:e,page:o}});s&&(console.log("res: ",s.data.data),d([...r,...s.data.data]),c(s.data.meta.pagination))}catch(s){p(s)}}return console.log("video-play: ",r),n.useEffect(()=>{g(30,1)},[]),a.jsx(l,{className:"w-100",children:a.jsx(v,{span:24,align:"middle",children:a.jsxs("div",{className:"layout-max-width",children:[a.jsx("div",{className:"pt-10 mb-20",children:a.jsxs(l,{align:"middle",className:"pt-10 fs-18",children:[a.jsx(y,{className:"t-primary ml-10"}),a.jsx("span",{className:"ml-10 t-primary font-battambang-bold",children:i("video")})]})}),a.jsx(N,{dataLength:r.length,next:()=>u(30,(t==null?void 0:t.current)+1),hasMore:r.length<(t==null?void 0:t.total),loader:a.jsx(l,{justify:"center",children:i("loading-info")}),children:a.jsx(x,{grid:{xs:1,sm:1,md:2,lg:2,xl:3,xxl:3},dataSource:r,renderItem:e=>a.jsxs(x.Item,{className:"pl-10 pr-10 pb-20",onClick:()=>h("view",{state:{...e}}),children:[a.jsx("div",{className:"video-card-list-container",children:a.jsx(b,{width:"100%",height:"100%",controls:!0,url:e.videoLink})}),a.jsx(l,{children:a.jsx("p",{className:"pl-10 pr-10",children:e.title})})]})})})]})})})}export{C as default};