"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9088],{69088:function(e,t,n){n.r(t);var l=n(29439),r=n(72791),i=n(29945),c=n(87995),o=n(81551),s=n(9505),u=n(23508),a=n(80184);t.default=function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,d=e.selectedBucket,p=e.ruleToDelete,f=e.rulesToDelete,b=e.remainingRules,h=e.allSelected,x=e.deleteSelectedRules,j=void 0!==x&&x,m=(0,o.TL)(),v=(0,r.useState)(""),k=(0,l.Z)(v,2),g=k[0],D=k[1],T=(0,s.Z)((function(){return t(!0)}),(function(e){return m((0,c.Ih)(e))})),y=(0,l.Z)(T,2),R=y[0],C=y[1];if(!d)return null;return(0,a.jsx)(u.Z,{title:j?"Delete Selected Replication Rules":"Delete Replication Rule",confirmText:"Delete",isOpen:n,titleIcon:(0,a.jsx)(i.NvT,{}),isLoading:R,onConfirm:function(){var e="/api/v1/buckets/".concat(d,"/replication/").concat(p);if(j){if(!h)return e="/api/v1/buckets/".concat(d,"/delete-selected-replication-rules"),void C("DELETE",e,{rules:f});e="/api/v1/buckets/".concat(d,"/delete-all-replication-rules")}else 1===b&&(e="/api/v1/buckets/".concat(d,"/delete-all-replication-rules"));C("DELETE",e)},onClose:function(){return t(!1)},confirmButtonProps:{disabled:j&&"Yes, I am sure"!==g},confirmationContent:(0,a.jsx)(r.Fragment,{children:j?(0,a.jsxs)(r.Fragment,{children:["Are you sure you want to remove the selected replication rules for bucket ",(0,a.jsx)("b",{children:d}),"?",(0,a.jsx)("br",{}),(0,a.jsx)("br",{}),"To continue please type ",(0,a.jsx)("b",{children:"Yes, I am sure"})," in the box.",(0,a.jsx)(i.rjZ,{item:!0,xs:12,children:(0,a.jsx)(i.Wzg,{id:"retype-tenant",name:"retype-tenant",onChange:function(e){D(e.target.value)},label:"",value:g})})]}):(0,a.jsxs)(r.Fragment,{children:["Are you sure you want to delete replication rule"," ",(0,a.jsx)("b",{children:p}),"?"]})})})}}}]);
//# sourceMappingURL=9088.9dd285c2.chunk.js.map