import{j as e,aO as j,h as t,i as C,o as r,s as m,ar as v,dv as E,cx as h,cy as u,aR as L}from"./app-BgLa5dit.js";import{E as I}from"./BCu-Zxz3.chunk.js";import{E as g}from"./RTbqjc8Y.chunk.js";import{E as i}from"./0GREfvNX.chunk.js";import"./BfMtaC_g.chunk.js";function k(a){return e.jsxs(i,{children:[e.jsx(i.Image,{src:j.EmptyStates.CLIPS}),e.jsx(i.Heading,{children:"No clips"}),e.jsx(i.Info,{children:"No clips have been created on this video yet."}),e.jsx(i.Cta,{text:"Create a clip",appLink:{application:C.CLIPS,action:t.Clips.CREATE_CLIP,args:[a.videoId]}})]})}const c=C.CLIPS,s=a=>({application:c,action:t.Clips.PREVIEW_CLIP,args:[a.id]});function f(a){const n=r(m.video(a.videoId)),p=r(L.currentUser()),o=r(m.videoClips(a.videoId)),x=!o.data||!p.data||!n.data;return e.jsxs(e.Fragment,{children:[e.jsx(g,{videoId:a.videoId,activeAction:t.Videos.EDIT_VIDEO_CLIPS,currentUser:p.data}),x?e.jsx("div",{className:"text-center mt-5",children:e.jsx(v,{as:"div",animation:"border",role:"status"})}):o.data.data.length?e.jsxs(e.Fragment,{children:[e.jsx(I,{memberName:"Clips",video:n.data}),e.jsx(E,{collection:o.data,columns:[{header:"ID",accessor:"id",appLink:s},{header:"Name",accessor:"name",appLink:s},{header:"Description",accessor:"description",appLink:s},{header:"Status",accessor:d=>e.jsx("div",{className:"d-inline-block",children:e.jsx(h,{data:d.status,type:u.Status})}),appLink:s},{header:"Creator",accessor:d=>{var l;return((l=d.owner)==null?void 0:l.email)??"Unknown"},appLink:s}],collectionAppLink:{application:c,action:t.Videos.EDIT_VIDEO_CLIPS},newObjectAppLink:{application:c,action:t.Clips.CREATE_CLIP,args:[a.videoId]},objectName:"Clip"})]}):e.jsxs(e.Fragment,{children:[e.jsx(I,{memberName:"Clips",video:n.data}),e.jsx(k,{videoId:a.videoId})]})]})}export{f as EditVideoClipsView};
//# sourceMappingURL=CLfk2Y6F.chunk.js.map
