"use strict";(self.webpackChunkhopsworks_front=self.webpackChunkhopsworks_front||[]).push([[6641],{56641:function(n,t,e){e.r(t),e.d(t,{default:function(){return g}});var i=e(76237),o=e(1281),r=e(16871),c=e(81497),u=e(15861),a=e(29439),s=e(87757),f=e.n(s),p=e(72791),l=e(95048),d=e(31874),h=e(1194),x=e(60675),y=e(73598),k=function(){var n=(0,p.useState)(),t=(0,a.Z)(n,2),e=t[0],i=t[1],o=(0,l.v9)(h.a),r=(0,l.v9)(d.v$),c=(0,l.v9)(h._),s=(0,l.I0)(),k=(0,p.useState)(!0),v=(0,a.Z)(k,2),g=v[0],j=v[1];return(0,p.useEffect)((function(){s.scope.fetch()}),[s.scope]),(0,p.useEffect)((function(){function n(){return(n=(0,u.Z)(f().mark((function n(){var t,e,r,c,u;return f().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return e=(0,x.Z)().substring(5),r={name:"default_apiKey_".concat(e),scope:o},n.next=4,s.api.create({data:r});case 4:c=n.sent,null!==(t=c.data)&&void 0!==t&&t.key&&i(null===(u=c.data)||void 0===u?void 0:u.key);case 6:case"end":return n.stop()}}),n)})))).apply(this,arguments)}o&&o.length>0&&function(){n.apply(this,arguments)}()}),[s.api,o]),(0,y.Z)(r||c,100,j),{apiKey:e,isLoading:g}},v=e(80184),g=function(){var n=k(),t=n.apiKey,e=n.isLoading,u=(0,r.s0)();return e?(0,v.jsx)(c.Z,{}):(0,v.jsxs)(i.kC,{flexDirection:"column",width:"830px",mt:"140px",children:[(0,v.jsx)(i.B4,{fontSize:"18px",fontFamily:"Inter",fontWeight:"bold",textAlign:"center",children:"Save your Api key"}),(0,v.jsx)(i.xu,{mt:"40px",sx:{div:{borderStyle:"none"}},children:(0,v.jsxs)(i.oA,{children:[t&&(0,v.jsx)(i.B4,{fontSize:"12px",fontFamily:"Inter",fontWeight:"500",mb:"20px",children:"Copy this API key and paste it directly in your code to connect to Hopsworks"}),(0,v.jsx)(i.xu,{children:t?(0,v.jsx)(i.EK,{height:"auto",copyButton:!0,title:"API key",language:"shell",content:t}):(0,v.jsx)(i.xu,{children:(0,v.jsx)(i.UW,{width:"100%",type:i.u3.error,content:"Failed to generate Api key",cta:(0,v.jsx)(i.zx,{onClick:function(){u(o.Z.account.api.list)},intent:"inline",children:"Go to Api keys"})})})})]})})]})}},31874:function(n,t,e){e.d(t,{BO:function(){return o},ND:function(){return c},Xi:function(){return i},v$:function(){return r}});var i=function(n){return n.api},o=function(n){return n.loading.effects.api.fetch},r=function(n){return n.loading.effects.api.create},c=function(n){return n.loading.effects.api.edit}},1194:function(n,t,e){e.d(t,{_:function(){return o},a:function(){return i}});var i=function(n){return n.scope},o=function(n){return n.loading.effects.scope.fetch}},60675:function(n,t){t.Z=function(){return Math.random().toString(32)}}}]);
//# sourceMappingURL=6641.918cc033.chunk.js.map