"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[1705],{71705:function(e,n,t){t.r(n);var l=t(29439),s=t(72791),o=t(9505),i=t(64554),c=t(56087),a=t(38442),u=t(26181),r=t.n(u),d=t(81918),h=t(29823),f=t(42419),p=t(75578),v=t(72401),x=t(87995),Z=t(25469),T=t(80184),j=(0,p.Z)(s.lazy((function(){return t.e(247).then(t.bind(t,40247))}))),m=(0,p.Z)(s.lazy((function(){return t.e(2408).then(t.bind(t,22763))})));n.default=function(e){var n=e.bucketName,t=(0,Z.TL)(),u=(0,s.useState)(null),p=(0,l.Z)(u,2),b=p[0],k=p[1],g=(0,s.useState)(!1),G=(0,l.Z)(g,2),_=G[0],y=G[1],C=(0,s.useState)([]),A=(0,l.Z)(C,2),S=A[0],U=A[1],E=(0,s.useState)(["",""]),I=(0,l.Z)(E,2),N=I[0],z=I[1],w=(0,s.useState)(!1),F=(0,l.Z)(w,2),P=F[0],B=F[1],K=(0,o.Z)((function(e){var n,t;null!=e&&null!=(null===e||void 0===e?void 0:e.details)&&"tags"in(null===e||void 0===e?void 0:e.details)&&(k(null===e||void 0===e||null===(n=e.details)||void 0===n?void 0:n.tags),U(Object.keys(null===e||void 0===e||null===(t=e.details)||void 0===t?void 0:t.tags)))}),(function(e){t((0,x.Ih)(e))})),O=(0,l.Z)(K,2),D=O[0],H=O[1],L=function(){H("GET","/api/v1/buckets/".concat(n))};return(0,s.useEffect)((function(){L()}),[n]),(0,T.jsxs)(i.Z,{children:[D?(0,T.jsx)(v.Z,{style:{width:16,height:16}}):null,(0,T.jsx)(a.s,{scopes:[c.Ft.S3_GET_BUCKET_TAGGING],resource:n,children:(0,T.jsxs)(i.Z,{sx:{display:"flex",flexFlow:"column"},children:[(0,T.jsx)(i.Z,{children:S&&S.map((function(e,t){var l=r()(b,"".concat(e),"");return""!==l?(0,T.jsx)(a.s,{scopes:[c.Ft.S3_PUT_BUCKET_TAGGING],resource:n,matchAll:!0,errorProps:{deleteIcon:null,onDelete:null},children:(0,T.jsx)(d.Z,{style:{textTransform:"none",marginRight:"5px"},size:"small",label:"".concat(e," : ").concat(l),color:"primary",deleteIcon:(0,T.jsx)(h.Z,{}),onDelete:function(){!function(e,n){z([e,n]),B(!0)}(e,l)}})},"chip-".concat(t)):null}))}),(0,T.jsx)(a.s,{scopes:[c.Ft.S3_PUT_BUCKET_TAGGING],resource:n,errorProps:{disabled:!0,onClick:null},children:(0,T.jsx)(d.Z,{style:{maxWidth:80,marginTop:"10px"},icon:(0,T.jsx)(f.Z,{}),clickable:!0,size:"small",label:"Add tag",color:"primary",variant:"outlined",onClick:function(){y(!0)}})})]})}),_&&(0,T.jsx)(j,{modalOpen:_,currentTags:b,bucketName:n,onCloseAndUpdate:function(e){y(!1),e&&L()}}),P&&(0,T.jsx)(m,{deleteOpen:P,currentTags:b,bucketName:n,onCloseAndUpdate:function(e){B(!1),e&&L()},selectedTag:N})]})}},42419:function(e,n,t){var l=t(95318);n.Z=void 0;var s=l(t(45649)),o=t(80184),i=(0,s.default)((0,o.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");n.Z=i}}]);
//# sourceMappingURL=1705.0a3da076.chunk.js.map