"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[1303],{1303:(e,t,a)=>{a.r(t),a.d(t,{default:()=>g});var n=a(65043),l=a(89923),r=a(77403),s=a(94141),o=a(64159),i=a(21383),d=a(56629),c=a(53518),u=a(70579);const g=e=>{let{modalOpen:t,currentTags:a,onCloseAndUpdate:g,bucketName:m}=e;const p=(0,i.jL)(),[b,h]=(0,n.useState)(""),[x,w]=(0,n.useState)(""),[j,C]=(0,n.useState)(!1);return(0,u.jsx)(s.A,{modalOpen:t,title:"Add New Tag ",onClose:()=>{g(!1)},titleIcon:(0,u.jsx)(l.b_$,{}),children:(0,u.jsxs)(l.Hbc,{withBorders:!1,containerPadding:!1,children:[(0,u.jsxs)(l.azJ,{sx:{marginBottom:15},children:[(0,u.jsx)("strong",{children:"Bucket"}),": ",m]}),(0,u.jsx)(l.cl_,{value:b,label:"New Tag Key",id:"newTagKey",name:"newTagKey",placeholder:"Enter New Tag Key",onChange:e=>{h(e.target.value)}}),(0,u.jsx)(l.cl_,{value:x,label:"New Tag Label",id:"newTagLabel",name:"newTagLabel",placeholder:"Enter New Tag Label",onChange:e=>{w(e.target.value)}}),(0,u.jsxs)(l.xA9,{item:!0,xs:12,sx:r.Uz.modalButtonBar,children:[(0,u.jsx)(l.$nd,{id:"clear",type:"button",variant:"regular",onClick:()=>{w(""),h("")},label:"Clear"}),(0,u.jsx)(l.$nd,{id:"save-add-bucket-tag",type:"submit",variant:"callAction",color:"primary",disabled:""===x.trim()||""===b.trim()||j,onClick:()=>{C(!0);const e={};e[b]=x;const t={...a,...e};d.F.buckets.putBucketTags(m,{tags:t}).then((()=>{C(!1),g(!0)})).catch((e=>{p((0,o.Dy)((0,c.S)(e.error))),C(!1)}))},label:"Save"})]})]})})}},94141:(e,t,a)=>{a.d(t,{A:()=>c});var n=a(65043),l=a(22166),r=a(89923),s=a(21383),o=a(64159),i=a(49555),d=a(70579);const c=e=>{let{onClose:t,modalOpen:a,title:c,children:u,wideLimit:g=!0,titleIcon:m=null,iconColor:p="default",sx:b}=e;const h=(0,s.jL)(),[x,w]=(0,n.useState)(!1),j=(0,l.d4)((e=>e.system.modalSnackBar));(0,n.useEffect)((()=>{h((0,o.h0)(""))}),[h]),(0,n.useEffect)((()=>{if(j){if(""===j.message)return void w(!1);"error"!==j.type&&w(!0)}}),[j]);let C="";return j&&(C=j.detailedErrorMsg,(""===C||C&&C.length<5)&&(C=j.message)),(0,d.jsxs)(r.ngX,{onClose:t,open:a,title:c,titleIcon:m,widthLimit:g,sx:b,iconColor:p,children:[(0,d.jsx)(i.A,{isModal:!0}),(0,d.jsx)(r.qb_,{onClose:()=>{w(!1),h((0,o.h0)(""))},open:x,message:C,mode:"inline",variant:"error"===j.type?"error":"default",autoHideDuration:"error"===j.type?10:5,condensed:!0}),u]})}}}]);
//# sourceMappingURL=1303.6fa13ab4.chunk.js.map