"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[4084],{94084:(e,t,l)=>{l.r(t),l.d(t,{default:()=>u});var n=l(69060),s=l(66152),r=l(95705),c=l(66156),a=l(89940),i=l(70780),o=l(82496);const u=e=>{let{closeDeleteModalAndRefresh:t,deleteOpen:l,selectedBucket:u,ruleToDelete:d,rulesToDelete:p,remainingRules:b,allSelected:x,deleteSelectedRules:h=!1}=e;const m=(0,c.Ab)(),[f,j]=(0,n.useState)(""),[k,v]=(0,a.c)((()=>t(!0)),(e=>m((0,r.aW)(e))));if(!u)return null;return(0,o.jsx)(i.c,{title:h?"Delete Selected Replication Rules":"Delete Replication Rule",confirmText:"Delete",isOpen:l,titleIcon:(0,o.jsx)(s.sB6,{}),isLoading:k,onConfirm:()=>{let e="/api/v1/buckets/".concat(u,"/replication/").concat(d);if(h){if(!x)return e="/api/v1/buckets/".concat(u,"/delete-selected-replication-rules"),void v("DELETE",e,{rules:p});e="/api/v1/buckets/".concat(u,"/delete-all-replication-rules")}else 1===b&&(e="/api/v1/buckets/".concat(u,"/delete-all-replication-rules"));v("DELETE",e)},onClose:()=>t(!1),confirmButtonProps:{disabled:h&&"Yes, I am sure"!==f},confirmationContent:(0,o.jsx)(n.Fragment,{children:h?(0,o.jsxs)(n.Fragment,{children:["Are you sure you want to remove the selected replication rules for bucket ",(0,o.jsx)("b",{children:u}),"?",(0,o.jsx)("br",{}),(0,o.jsx)("br",{}),"To continue please type ",(0,o.jsx)("b",{children:"Yes, I am sure"})," in the box.",(0,o.jsx)(s.yeN,{item:!0,xs:12,children:(0,o.jsx)(s.q22,{id:"retype-tenant",name:"retype-tenant",onChange:e=>{j(e.target.value)},label:"",value:f})})]}):(0,o.jsxs)(n.Fragment,{children:["Are you sure you want to delete replication rule"," ",(0,o.jsx)("b",{children:d}),"?"]})})})}}}]);
//# sourceMappingURL=4084.19418226.chunk.js.map