import{R as l,o as d,p as i,l as h,k as g,j as e,E as v,a9 as a,aJ as p}from"./app-BgLa5dit.js";function m(s){const[o,c]=l.useState(!1),t=d(i.getMasterVideo(s.id)),n=h(),r=g();async function u(){c(!0),r(i.updateVideoStatus(s.id,p.Archived,s.stage)).then(()=>{n.success(`Successfully archived <strong>${t.data.name}</strong>.`),s.closePopup()}).catch(()=>{n.error(`Something went wrong while archiving <strong>${t.data.name}</strong>. Please try again.`),s.closePopup()})}return e.jsx(v,{title:"Archive video",closePopup:s.closePopup,showLoadingSpinner:!t.data,children:!!t.data&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Are you sure you want to archive ",e.jsx("strong",{children:t.data.name}),"?"]}),e.jsxs(a,{children:[e.jsx(a.Cancel,{onClick:s.closePopup}),e.jsx(a.Submit,{showSpinner:o,onClick:u,variant:"danger",text:"Archive video"})]})]})})}export{m as ArchiveVideoView};
//# sourceMappingURL=C7jD9t-u.chunk.js.map
