import{j as e,aO as j,h as i,i as E,o as n,r as l,ar as C,dv as x,cx as T,cy as u,aR as h}from"./app-BgLa5dit.js";import{O as v}from"./B-fq6xxv.chunk.js";import{E as N}from"./kJGoOu-N.chunk.js";import{E as a}from"./0GREfvNX.chunk.js";import"./BfMtaC_g.chunk.js";function A(t){return e.jsxs(a,{children:[e.jsx(a.Image,{src:j.EmptyStates.INTERACTIVES}),e.jsx(a.Heading,{children:"No interactives"}),e.jsx(a.Info,{children:"No interactives have been created on this clip yet."}),e.jsx(a.Cta,{text:"Create an interactive",appLink:{application:E.INTERACTIVES,action:i.Interactives.NEW_INTERACTIVE,args:[t.clipId]}})]})}const o=E.INTERACTIVES,r=t=>({application:o,action:i.Interactives.PREVIEW_INTERACTIVE,args:[t.id]});function f(t){const p=n(l.clip(t.clipId)),d=n(h.currentUser()),s=n(l.clipInteractives(t.clipId)),m=!s.data||!d.data||!p.data;return e.jsxs(e.Fragment,{children:[e.jsx(N,{clipId:t.clipId,activeAction:i.Clips.EDIT_CLIP_INTERACTIVES,currentUser:d.data}),m?e.jsx("div",{className:"text-center mt-5",children:e.jsx(C,{as:"div",animation:"border",role:"status"})}):s.data.data.length?e.jsxs(e.Fragment,{children:[e.jsx(v,{object:p.data}),e.jsx(x,{collection:s.data,columns:[{header:"ID",accessor:"id",appLink:r},{header:"Name",accessor:"name",appLink:r},{header:"Description",accessor:"description",appLink:r},{header:"Status",accessor:c=>e.jsx(T,{data:c.status,type:u.Status})},{header:"Creator",accessor:c=>{var I;return((I=c.owner)==null?void 0:I.email)??"Unknown"}}],collectionAppLink:{application:o,action:i.Clips.EDIT_CLIP_INTERACTIVES},newObjectAppLink:{application:o,action:i.Interactives.NEW_INTERACTIVE,args:[t.clipId]},objectName:"Interactive"})]}):e.jsx(A,{clipId:t.clipId})]})}export{f as EditClipInteractivesView};
//# sourceMappingURL=ClhNmRsk.chunk.js.map
