"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[5809],{5809:(e,l,s)=>{s.r(l),s.d(l,{default:()=>v});var t=s(65043),a=s(33097),n=s.n(a),r=s(89923),d=s(99161),i=s(77938),o=s(64159),c=s(21383),u=s(25448),p=s(72237),x=s(70579);const T=(0,p.A)(t.lazy((()=>s.e(1303).then(s.bind(s,1303))))),h=(0,p.A)(t.lazy((()=>s.e(5079).then(s.bind(s,55079))))),v=e=>{let{bucketName:l}=e;const s=(0,c.jL)(),[a,p]=(0,t.useState)(null),[v,_]=(0,t.useState)(!1),[A,S]=(0,t.useState)([]),[b,j]=(0,t.useState)(["",""]),[O,C]=(0,t.useState)(!1),[g,k]=(0,u.A)((e=>{if(e&&null!=(null===e||void 0===e?void 0:e.details)){var l,s;if(e.details.tags)return p(null===e||void 0===e||null===(l=e.details)||void 0===l?void 0:l.tags),void S(Object.keys(null===e||void 0===e||null===(s=e.details)||void 0===s?void 0:s.tags));p([]),S([])}}),(e=>{s((0,o.C9)(e))})),G=()=>{k("GET",`/api/v1/buckets/${l}`)};return(0,t.useEffect)((()=>{G()}),[l]),(0,x.jsxs)(r.azJ,{children:[g?(0,x.jsx)(r.aHM,{style:{width:16,height:16}}):null,(0,x.jsx)(i.R,{scopes:[d.OV.S3_GET_BUCKET_TAGGING,d.OV.S3_GET_ACTIONS],resource:l,children:(0,x.jsx)(r.azJ,{sx:{display:"flex",flexFlow:"column",marginTop:5},children:(0,x.jsxs)(r.azJ,{sx:{display:"flex",gap:8,flexWrap:"wrap"},children:[A&&A.map(((e,s)=>{const t=n()(a,`${e}`,"");return""!==t?(0,x.jsx)(i.R,{scopes:[d.OV.S3_PUT_BUCKET_TAGGING,d.OV.S3_PUT_ACTIONS],resource:l,matchAll:!0,errorProps:{deleteIcon:null,onDelete:null},children:(0,x.jsx)(r.vwO,{label:`${e} : ${t}`,id:`tag-${e}-${t}`,onDelete:()=>{((e,l)=>{j([e,l]),C(!0)})(e,t)}})},`chip-${s}`):null})),(0,x.jsx)(i.R,{scopes:[d.OV.S3_PUT_BUCKET_TAGGING,d.OV.S3_PUT_ACTIONS],resource:l,errorProps:{disabled:!0,onClick:null},children:(0,x.jsx)(r.vwO,{label:"Add tag",icon:(0,x.jsx)(r.REV,{}),id:"create-tag",variant:"outlined",onClick:()=>{_(!0)},sx:{cursor:"pointer",maxWidth:90}})})]})})}),v&&(0,x.jsx)(T,{modalOpen:v,currentTags:a,bucketName:l,onCloseAndUpdate:e=>{_(!1),e&&G()}}),O&&(0,x.jsx)(h,{deleteOpen:O,currentTags:a,bucketName:l,onCloseAndUpdate:e=>{C(!1),e&&G()},selectedTag:b})]})}},25448:(e,l,s)=>{s.d(l,{A:()=>n});var t=s(65043),a=s(20649);const n=(e,l)=>{const[s,n]=(0,t.useState)(!1);return[s,(s,t,r,d)=>{n(!0),a.A.invoke(s,t,r,d).then((l=>{n(!1),e(l)})).catch((e=>{n(!1),l(e)}))}]}}}]);
//# sourceMappingURL=5809.a7e08101.chunk.js.map