"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(51691),a=n(9505),o=n(23508),s=n(38734),c=n(61889),u=n(21435),d=n(16502),b=n(87995),p=n(25469),f=n(80184);t.default=function(e){var t=e.closeDeleteModalAndRefresh,n=e.deleteOpen,h=e.selectedBucket,m=e.ruleToDelete,x=e.rulesToDelete,g=e.remainingRules,j=e.allSelected,v=e.deleteSelectedRules,k=void 0!==v&&v,T=(0,p.TL)(),Z=(0,r.useState)(""),C=(0,l.Z)(Z,2),R=C[0],D=C[1],y=(0,a.Z)((function(){return t(!0)}),(function(e){return T((0,b.Ih)(e))})),w=(0,l.Z)(y,2),E=w[0],L=w[1];if(!h)return null;return(0,f.jsx)(o.Z,{title:k?"Delete Selected Replication Rules":"Delete Replication Rule",confirmText:"Delete",isOpen:n,titleIcon:(0,f.jsx)(s.NvT,{}),isLoading:E,onConfirm:function(){var e="/api/v1/buckets/".concat(h,"/replication/").concat(m);if(k){if(!j)return e="/api/v1/buckets/".concat(h,"/delete-selected-replication-rules"),void L("DELETE",e,{rules:x});e="/api/v1/buckets/".concat(h,"/delete-all-replication-rules")}else 1===g&&(e="/api/v1/buckets/".concat(h,"/delete-all-replication-rules"));L("DELETE",e)},onClose:function(){return t(!1)},confirmButtonProps:{disabled:k&&"Yes, I am sure"!==R},confirmationContent:(0,f.jsx)(i.Z,{children:k?(0,f.jsxs)(r.Fragment,{children:[(0,f.jsx)(d.Z,{title:"Warning",label:"The corresponding remote buckets will also be deleted."}),"Are you sure you want to remove the selected replication rules for bucket ",(0,f.jsx)("b",{children:h}),"?",(0,f.jsx)("br",{}),(0,f.jsx)("br",{}),"To continue please type ",(0,f.jsx)("b",{children:"Yes, I am sure"})," in the box.",(0,f.jsx)(c.ZP,{item:!0,xs:12,children:(0,f.jsx)(u.Z,{id:"retype-tenant",name:"retype-tenant",onChange:function(e){D(e.target.value)},label:"",value:R})})]}):(0,f.jsxs)(r.Fragment,{children:[(0,f.jsx)(d.Z,{title:"Warning",label:"The corresponding remote bucket will also be deleted."}),"Are you sure you want to delete replication rule"," ",(0,f.jsx)("b",{children:m}),"?"]})})})}},16502:function(e,t,n){n(72791);var l=n(11135),r=n(25787),i=n(80184);t.Z=(0,r.Z)((function(e){return(0,l.Z)({headerContainer:{backgroundColor:"#e78794",borderRadius:3,marginBottom:20,padding:1,paddingBottom:15},labelHeadline:{color:"#000000",fontSize:14,marginLeft:20},labelText:{color:"#000000",fontSize:14,marginLeft:20,marginRight:40}})}))((function(e){var t=e.classes,n=e.label,l=e.title;return(0,i.jsxs)("div",{className:t.headerContainer,children:[(0,i.jsx)("h4",{className:t.labelHeadline,children:l}),(0,i.jsx)("div",{className:t.labelText,children:n})]})}))}}]);
//# sourceMappingURL=9088.c0ec4658.chunk.js.map