"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[402],{70402:function(n,e,i){i.r(e);var t=i(29439),o=i(72791),s=i(51691),r=i(81207),c=i(23508),a=i(38734),l=i(87995),u=i(25469),d=i(80184);e.default=function(n){var e=n.closeVersioningModalAndRefresh,i=n.modalOpen,f=n.selectedBucket,h=n.versioningCurrentState,b=(0,u.TL)(),g=(0,o.useState)(!1),p=(0,t.Z)(g,2),v=p[0],j=p[1];return(0,d.jsx)(c.Z,{title:"Versioning on Bucket",confirmText:h?"Disable":"Enable",isOpen:i,isLoading:v,titleIcon:(0,d.jsx)(a.EjK,{}),onConfirm:function(){v||(j(!0),r.Z.invoke("PUT","/api/v1/buckets/".concat(f,"/versioning"),{versioning:!h}).then((function(){j(!1),e(!0)})).catch((function(n){j(!1),b((0,l.Ih)(n))})))},confirmButtonProps:{variant:"callAction"},onClose:function(){e(!1)},confirmationContent:(0,d.jsxs)(s.Z,{id:"alert-dialog-description",children:["Are you sure you want to"," ",(0,d.jsx)("strong",{children:h?"disable":"enable"})," ","versioning for this bucket?",h&&(0,d.jsxs)(o.Fragment,{children:[(0,d.jsx)("br",{}),(0,d.jsx)("br",{}),(0,d.jsx)("strong",{children:"File versions won't be automatically deleted."})]})]})})}}}]);
//# sourceMappingURL=402.bce64a61.chunk.js.map