import{R as p,o as d,aC as x,j as e,O as g,g as m,h as r,i as j,dv as S,cx as y,cy as L,ar as N}from"./app-BgLa5dit.js";import{S as f}from"./BYtBBUvs.chunk.js";const s=j.STREAMABLE_LEARNING,u=a=>({application:s,action:r.StreamableLearning.EDIT_VIDEO,args:[a.id]});function k(a){const[n,h]=p.useState(a.query||""),i=d(f.library()),c=d(i.data&&x.libraryVideos(i.data.objectId,a.query,a.cursor));function b(t){t.preventDefault();const l={application:s,action:r.StreamableLearning.VIDEOS};n.length&&(l.params={query:n}),m.trigger(l)}const o={application:s,action:r.StreamableLearning.VIDEOS};return a.query&&(o.params={query:a.query}),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"row mb-2",children:[e.jsxs("form",{onSubmit:b,className:"col-6",children:[e.jsx("label",{htmlFor:"search",children:"Search:"}),e.jsxs("div",{className:"input-group",children:[e.jsx("input",{id:"search",className:"form-control border-dark",value:n,onChange:t=>h(t.target.value),placeholder:"Enter a video name..."}),e.jsx("button",{className:"btn btn-outline-dark",type:"submit",children:"Search"})]})]}),e.jsx("div",{className:"col-6 d-flex align-items-end justify-content-end",children:e.jsx(g,{className:"btn btn-dark",onClick:()=>m.trigger({application:s,action:r.StreamableLearning.EXPORT_LIBRARY}),children:"Export library"})})]}),c.hasCompleted?e.jsx(S,{collection:c.data,columns:[{header:"ID",accessor:"id",appLink:u},{header:"Name",accessor:"name",appLink:u},{header:"Status",accessor:t=>e.jsx(y,{data:t.status,type:L.Status})}],collectionAppLink:o,objectName:"Video"}):e.jsx("div",{className:"mt-5 text-center",children:e.jsx(N,{})})]})}export{k as StreamableVideosView};
//# sourceMappingURL=D1hc-q5L.chunk.js.map
