import{aJ as E,gx as b,S as v,bc as L,g as l,ao as e,aF as N,L as j,aq as D,bU as t,c as g,k as O,U as u,i as k,A as y}from"./app-k0jcl5PQ.js";const h="upload.cancelUpload",s=j.encloseNamespace(h);function T(a){const{id:i,status:n,name:r}=a,[P,U]=E.useState(!1),p=b(v.CombineUploads),C=L(),c=n===l.Uploading,d=()=>{const o=c?"cancelUploadingAlertHeading":"cancelProcessingAlertHeading",A=c?"cancelUploadingAlertMessage":"cancelProcessingAlertMessage";C.success({type:y.Success,heading:s(o),message:s(A,{videoName:r,escapeText:!0})}),a.closePopup()},m=()=>{U(!0),c?(p.cancelUpload(i),g.Radio.channel(O.VIDEO_UPLOAD).once(u.UPLOAD_CANCELLED,()=>d())):(p.cancelProcessing(i),g.Radio.channel(k.COMBINE_UPLOADS).once(u.PROCESSING_CANCELLED,()=>d()))},S=n===l.Processing?"cancelProcessingTitle":"cancelUploadingTitle",x=n===l.Processing?"cancelProcessingMessage":"cancelUploadingMessage";return e.jsxs(N,{title:s(S),closePopup:a.closePopup,children:[e.jsx("p",{children:e.jsx(D,{namespace:h,phrase:x,options:{videoName:r}})}),e.jsxs(t,{children:[e.jsx(t.Cancel,{text:s("no"),onClick:a.closePopup}),e.jsx(t.Submit,{variant:"dark",text:s("yes"),onClick:m,showSpinner:P})]})]})}export{T as CancelUploadView};
//# sourceMappingURL=CCCvlRP7.chunk.js.map
