"use strict";(self.webpackChunkweb_app=self.webpackChunkweb_app||[]).push([[3556],{43556:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(69060),s=a(66152),c=a(51560),r=a(21124),l=a(66156),i=a(61628),o=a(52224),x=a(61180),d=a(95705),y=a(78256),m=a(82496);const p=()=>{const e=(0,l.Ab)(),t=(0,c.i6)(),[a,p]=(0,n.useState)(""),[h,j]=(0,n.useState)(!1),u=""!==a.trim()&&-1===a.indexOf(" ");return(0,m.jsx)(s._al,{children:(0,m.jsx)(s.yE_,{title:"Create Key",icon:(0,m.jsx)(s.MV9,{}),helpBox:(0,m.jsx)(o.c,{helpText:"Encryption Key",contents:["Create a new cryptographic key in the Key Management Service server connected to MINIO."]}),children:(0,m.jsx)("form",{noValidate:!0,autoComplete:"off",onSubmit:n=>{n.preventDefault(),j(!0),x.m.kms.kmsCreateKey({key:a}).then((e=>{t("".concat(r.Ks.KMS_KEYS))})).catch((async t=>{const a=await t.json();e((0,d.aW)((0,y.K)(a)))})).finally((()=>j(!1)))},children:(0,m.jsxs)(s.yeN,{container:!0,children:[(0,m.jsx)(s.yeN,{item:!0,xs:12,children:(0,m.jsx)(s.q22,{id:"key-name",name:"key-name",label:"Key Name",autoFocus:!0,value:a,error:(e=>-1!==e.indexOf(" ")?"Key name cannot contain spaces":"")(a),onChange:e=>{p(e.target.value)}})}),(0,m.jsxs)(s.yeN,{item:!0,xs:12,sx:i.W2.modalButtonBar,children:[(0,m.jsx)(s.qaq,{id:"clear",type:"button",variant:"regular",onClick:()=>{p("")},label:"Clear"}),(0,m.jsx)(s.qaq,{id:"save-key",type:"submit",variant:"callAction",color:"primary",disabled:h||!u,label:"Save"})]})]})})})})};var h=a(3428),j=a(48504);const u=()=>{const e=(0,l.Ab)(),t=(0,c.i6)();return(0,n.useEffect)((()=>{e((0,d.i8)("add_key"))}),[]),(0,m.jsx)(n.Fragment,{children:(0,m.jsxs)(s.yeN,{item:!0,xs:12,children:[(0,m.jsx)(h.c,{label:(0,m.jsx)(s.y_F,{label:"Keys",onClick:()=>t(r.Ks.KMS_KEYS)}),actions:(0,m.jsx)(j.c,{})}),(0,m.jsx)(p,{})]})})}},52224:(e,t,a)=>{a.d(t,{c:()=>r});var n=a(69060),s=a(66152),c=a(82496);const r=e=>{let{helpText:t,contents:a}=e;return(0,c.jsx)(s.g1k,{iconComponent:(0,c.jsx)(s.cFZ,{}),title:t,help:(0,c.jsx)(n.Fragment,{children:a.map((e=>(0,c.jsx)(s.kvh,{sx:{paddingBottom:"20px"},children:e})))})})}}}]);
//# sourceMappingURL=3556.ab4ba514.chunk.js.map