"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[6013],{86013:function(e,n,t){t.r(n);var l=t(77439),o=t(57223),c=t(90055),s=t(95492),a=t(47178),i=t(38199),r=t(32542),u=t(67066),d=t.n(u),f=t(25143),v=t(71417),p=t(98421),h=t(77263),Z=t(18054),x=(0,h.Z)(o.lazy((function(){return Promise.all([t.e(4003),t.e(5646),t.e(731),t.e(5201),t.e(8408)]).then(t.bind(t,48408))}))),m=(0,h.Z)(o.lazy((function(){return Promise.all([t.e(5201),t.e(5976)]).then(t.bind(t,85976))})));n.default=function(e){var n=e.setErrorSnackMessage,t=e.bucketName,u=(0,o.useState)(null),h=(0,l.Z)(u,2),j=h[0],T=h[1],k=(0,o.useState)(!1),b=(0,l.Z)(k,2),G=b[0],_=b[1],S=(0,o.useState)([]),g=(0,l.Z)(S,2),y=g[0],C=g[1],A=(0,o.useState)(["",""]),E=(0,l.Z)(A,2),U=E[0],z=E[1],N=(0,o.useState)(!1),P=(0,l.Z)(N,2),I=P[0],F=P[1],w=(0,c.Z)((function(e){var n,t;null!=e&&null!=(null===e||void 0===e?void 0:e.details)&&(T(null===e||void 0===e||null===(n=e.details)||void 0===n?void 0:n.tags),C(Object.keys(null===e||void 0===e||null===(t=e.details)||void 0===t?void 0:t.tags)))}),(function(e){n(e)})),B=(0,l.Z)(w,2),K=B[0],O=B[1],D=function(){O("GET","/api/v1/buckets/".concat(t))};return(0,o.useEffect)((function(){D()}),[t]),(0,Z.jsxs)(s.Z,{children:[K?(0,Z.jsx)(a.Z,{color:"primary",size:16,variant:"indeterminate"}):null,(0,Z.jsx)(r.s,{scopes:[i.Ft.S3_GET_BUCKET_TAGGING],resource:t,children:(0,Z.jsxs)(s.Z,{sx:{display:"flex",flexFlow:"column"},children:[(0,Z.jsx)(s.Z,{children:y&&y.map((function(e,n){var l=d()(j,"".concat(e),"");return""!==l?(0,Z.jsx)(r.s,{scopes:[i.Ft.S3_PUT_BUCKET_TAGGING],resource:t,matchAll:!0,errorProps:{deleteIcon:null,onDelete:null},children:(0,Z.jsx)(f.Z,{style:{textTransform:"none",marginRight:"5px"},size:"small",label:"".concat(e," : ").concat(l),color:"primary",deleteIcon:(0,Z.jsx)(v.Z,{}),onDelete:function(){!function(e,n){z([e,n]),F(!0)}(e,l)}})},"chip-".concat(n)):null}))}),(0,Z.jsx)(r.s,{scopes:[i.Ft.S3_PUT_BUCKET_TAGGING],resource:t,errorProps:{disabled:!0,onClick:null},children:(0,Z.jsx)(f.Z,{style:{maxWidth:120,marginTop:"10px"},icon:(0,Z.jsx)(p.Z,{}),clickable:!0,size:"small",label:"\u6dfb\u52a0\u6807\u7b7e",color:"primary",variant:"outlined",onClick:function(){_(!0)}})})]})}),G&&(0,Z.jsx)(x,{modalOpen:G,currentTags:j,bucketName:t,onCloseAndUpdate:function(e){_(!1),e&&D()}}),I&&(0,Z.jsx)(m,{deleteOpen:I,currentTags:j,bucketName:t,onCloseAndUpdate:function(e){F(!1),e&&D()},selectedTag:U})]})}},90055:function(e,n,t){var l=t(77439),o=t(57223),c=t(64964);n.Z=function(e,n){var t=(0,o.useState)(!1),s=(0,l.Z)(t,2),a=s[0],i=s[1];return[a,function(t,l,o){i(!0),c.Z.invoke(t,l,o).then((function(n){i(!1),e(n)})).catch((function(e){i(!1),n(e)}))}]}},98421:function(e,n,t){var l=t(16060);n.Z=void 0;var o=l(t(92572)),c=t(18054),s=(0,o.default)((0,c.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");n.Z=s}}]);
//# sourceMappingURL=6013.2a18e4e3.chunk.js.map