import{j as e,aO as T,h as t,i as I,o as c,s as v,ar as x,dv as j,cx as N,cy as V,eq as u,aR as h}from"./app-BgLa5dit.js";import{E as m}from"./BCu-Zxz3.chunk.js";import{E as A}from"./RTbqjc8Y.chunk.js";import{E as s}from"./0GREfvNX.chunk.js";import"./BfMtaC_g.chunk.js";function C(a){return e.jsxs(s,{children:[e.jsx(s.Image,{src:T.EmptyStates.INTERACTIVES}),e.jsx(s.Heading,{children:"No interactives"}),e.jsx(s.Info,{children:"No interactives have been created on this video yet."}),e.jsx(s.Cta,{text:"Create an interactive",appLink:{application:I.INTERACTIVES,action:t.Interactives.NEW_INTERACTIVE,args:[a.videoId]}})]})}const d=I.INTERACTIVES,n=a=>({application:d,action:t.Interactives.PREVIEW_INTERACTIVE,args:[a.id]});function L(a){const r=c(v.video(a.videoId)),p=c(h.currentUser()),o=c(v.videoInteractives(a.videoId)),l=!o.data||!p.data||!r.data;return e.jsxs(e.Fragment,{children:[e.jsx(A,{videoId:a.videoId,activeAction:t.Videos.EDIT_VIDEO_INTERACTIVES,currentUser:p.data}),l?e.jsx("div",{className:"text-center mt-5",children:e.jsx(x,{as:"div",animation:"border",role:"status"})}):o.data.data.length?e.jsxs(e.Fragment,{children:[e.jsx(m,{memberName:"Interactives",video:r.data}),e.jsx(j,{disableResponsive:!0,collection:o.data,columns:[{header:"ID",accessor:"id",appLink:n},{header:"Name",accessor:"name",appLink:n},{header:"Description",accessor:"description",appLink:n},{header:"Status",accessor:i=>e.jsx(N,{data:i.status,type:V.Status}),appLink:n},{header:"Creator",accessor:i=>{var E;return((E=i.owner)==null?void 0:E.email)??"Unknown"},appLink:n},{header:"Actions",accessor:i=>e.jsx(u,{actions:[{label:"Copy interactive",appLink:{application:I.INTERACTIVES,action:t.Interactives.COPY_INTERACTIVE,args:[i.id]}}],dropdownToggleClassName:"btn btn-outline-dark"})}],collectionAppLink:{application:d,action:t.Videos.EDIT_VIDEO_INTERACTIVES},newObjectAppLink:{application:d,action:t.Interactives.NEW_INTERACTIVE,args:[a.videoId]},objectName:"Interactive"})]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{memberName:"Interactives",video:r.data}),e.jsx(C,{videoId:a.videoId})]})]})}export{L as EditVideoInteractivesView};
//# sourceMappingURL=CeotO-XF.chunk.js.map
