"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[4528],{94528:(e,l,t)=>{t.r(l),t.d(l,{default:()=>_});var s=t(69060),a=t(58564),n=t.n(a),c=t(66152),i=t(21124),o=t(3992),d=t(95705),r=t(66156),u=t(89940),p=t(99748),h=t(82496);const x=(0,p.c)(s.lazy((()=>t.e(9844).then(t.bind(t,19844))))),T=(0,p.c)(s.lazy((()=>t.e(3052).then(t.bind(t,53052))))),_=e=>{let{bucketName:l}=e;const t=(0,r.Ab)(),[a,p]=(0,s.useState)(null),[_,v]=(0,s.useState)(!1),[b,k]=(0,s.useState)([]),[S,g]=(0,s.useState)(["",""]),[j,C]=(0,s.useState)(!1),[G,O]=(0,u.c)((e=>{if(e&&null!=(null===e||void 0===e?void 0:e.details)){var l,t;if(e.details.tags)return p(null===e||void 0===e||null===(l=e.details)||void 0===l?void 0:l.tags),void k(Object.keys(null===e||void 0===e||null===(t=e.details)||void 0===t?void 0:t.tags));p([]),k([])}}),(e=>{t((0,d.aW)(e))})),f=()=>{O("GET","/api/v1/buckets/".concat(l))};return(0,s.useEffect)((()=>{f()}),[l]),(0,h.jsxs)(c.kvh,{children:[G?(0,h.jsx)(c.c1M,{style:{width:16,height:16}}):null,(0,h.jsx)(o.K,{scopes:[i.Oi.S3_GET_BUCKET_TAGGING,i.Oi.S3_GET_ACTIONS],resource:l,children:(0,h.jsx)(c.kvh,{sx:{display:"flex",flexFlow:"column",marginTop:5},children:(0,h.jsxs)(c.kvh,{sx:{display:"flex",gap:8,flexWrap:"wrap"},children:[b&&b.map(((e,t)=>{const s=n()(a,"".concat(e),"");return""!==s?(0,h.jsx)(o.K,{scopes:[i.Oi.S3_PUT_BUCKET_TAGGING,i.Oi.S3_PUT_ACTIONS],resource:l,matchAll:!0,errorProps:{deleteIcon:null,onDelete:null},children:(0,h.jsx)(c.EDW,{label:"".concat(e," : ").concat(s),id:"tag-".concat(e,"-").concat(s),onDelete:()=>{((e,l)=>{g([e,l]),C(!0)})(e,s)}})},"chip-".concat(t)):null})),(0,h.jsx)(o.K,{scopes:[i.Oi.S3_PUT_BUCKET_TAGGING,i.Oi.S3_PUT_ACTIONS],resource:l,errorProps:{disabled:!0,onClick:null},children:(0,h.jsx)(c.EDW,{label:"Add tag",icon:(0,h.jsx)(c.EgV,{}),id:"create-tag",variant:"outlined",onClick:()=>{v(!0)},sx:{cursor:"pointer",maxWidth:90}})})]})})}),_&&(0,h.jsx)(x,{modalOpen:_,currentTags:a,bucketName:l,onCloseAndUpdate:e=>{v(!1),e&&f()}}),j&&(0,h.jsx)(T,{deleteOpen:j,currentTags:a,bucketName:l,onCloseAndUpdate:e=>{C(!1),e&&f()},selectedTag:S})]})}}}]);
//# sourceMappingURL=4528.d208fadc.chunk.js.map