"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9145],{59145:function(e,n,t){t.r(n),t.d(n,{default:function(){return y}});var i=t(29439),a=t(1413),o=t(72791),s=t(60364),c=t(11135),l=t(25787),r=t(61889),u=t(23814),d=t(25469),f=t(20890),p=t(45248),m=t(46431),x=t.n(m),h=t(43504),v=t(10703),g=t(40603),b=t(80184),Z=(0,l.Z)((function(e){return(0,c.Z)((0,a.Z)({paperContainer:{padding:"15px",display:"flex",alignItems:"center",justifyContent:"center"},licenseInfoValue:{textTransform:"none",fontSize:14,fontWeight:"bold"},licenseContainer:{position:"relative",padding:"20px 52px 0px 28px",background:"#032F51",boxShadow:"0px 3px 7px #00000014","& h2":{color:"#FFF",marginBottom:67},"& a":{textDecoration:"none"},"& h3":{color:"#FFFFFF",marginBottom:"30px",fontWeight:"bold"},"& h6":{color:"#FFFFFF !important"}},licenseInfo:{color:"#FFFFFF",position:"relative"},licenseInfoTitle:{textTransform:"none",color:"#BFBFBF",fontSize:11},verifiedIcon:{width:96,position:"absolute",right:0,bottom:29},noUnderLine:{textDecoration:"none"}},(0,u.Bz)(e.spacing(4))))}))((function(e){var n=e.classes,t=e.tenant,i=e.loadingActivateProduct,a=e.loadingLicenseInfo,s=e.licenseInfo,c=e.activateProduct;return(0,b.jsx)(v.Z,{className:t&&t.subnet_license?n.licenseContainer:"",children:t&&t.subnet_license?(0,b.jsx)(o.Fragment,{children:(0,b.jsxs)(r.ZP,{container:!0,className:n.licenseInfo,children:[(0,b.jsxs)(r.ZP,{item:!0,xs:6,children:[(0,b.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"License"}),(0,b.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:"Commercial License"}),(0,b.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Organization"}),(0,b.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:t.subnet_license.organization}),(0,b.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Registered Capacity"}),(0,b.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:(0,p.ae)((1099511627776*t.subnet_license.storage_capacity).toString(10))}),(0,b.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Expiry Date"}),(0,b.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:(0,b.jsx)(x(),{format:"YYYY-MM-DD",children:t.subnet_license.expires_at})})]}),(0,b.jsxs)(r.ZP,{item:!0,xs:6,children:[(0,b.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Subscription Plan"}),(0,b.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:t.subnet_license.plan}),(0,b.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Requestor"}),(0,b.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:t.subnet_license.email})]}),(0,b.jsx)("img",{className:n.verifiedIcon,src:"/verified.svg",alt:"verified"})]})}):!a&&(0,b.jsxs)(r.ZP,{className:n.paperContainer,children:[!s&&(0,b.jsx)(h.rU,{to:"/license",onClick:function(e){e.stopPropagation()},className:n.noUnderLine,children:(0,b.jsx)(g.Z,{tooltip:"Activate Product",text:"Activate Product",onClick:function(){return!1},color:"primary",variant:"contained"})}),s&&t&&(0,b.jsx)(g.Z,{disabled:i,tooltip:"Attach License",text:"Attach License",onClick:function(){return c(t.namespace,t.name)},color:"primary",variant:"contained"})]})})})),j=t(81207),F=t(72401),I=t(87995),k=t(17238),y=(0,l.Z)((function(e){return(0,c.Z)((0,a.Z)((0,a.Z)({},u.oZ),{},{loaderAlign:{textAlign:"center"}},(0,u.Bz)(e.spacing(4))))}))((function(e){var n=e.classes,t=(0,d.TL)(),a=(0,s.v9)((function(e){return e.tenants.loadingTenant})),c=(0,s.v9)((function(e){return e.tenants.tenantInfo})),l=(0,o.useState)(),u=(0,i.Z)(l,2),f=u[0],p=u[1],m=(0,o.useState)(!0),x=(0,i.Z)(m,2),h=x[0],v=x[1],g=(0,o.useState)(!1),y=(0,i.Z)(g,2),B=y[0],N=y[1];return(0,o.useEffect)((function(){h&&j.Z.invoke("GET","/api/v1/subscription/info").then((function(e){p(e),v(!1)})).catch((function(e){v(!1)}))}),[h]),(0,b.jsxs)(o.Fragment,{children:[(0,b.jsx)("h1",{className:n.sectionTitle,children:"License"}),a?(0,b.jsx)("div",{className:n.loaderAlign,children:(0,b.jsx)(F.Z,{})}):(0,b.jsx)(o.Fragment,{children:c&&(0,b.jsx)(r.ZP,{container:!0,children:(0,b.jsx)(r.ZP,{item:!0,xs:12,children:(0,b.jsx)(Z,{tenant:c,loadingLicenseInfo:h,loadingActivateProduct:B,licenseInfo:f,activateProduct:function(e,n){B||(N(!0),j.Z.invoke("POST","/api/v1/subscription/namespaces/".concat(e,"/tenants/").concat(n,"/activate"),{}).then((function(){N(!1),t((0,k.V2)(!0)),v(!0)})).catch((function(e){N(!1),t((0,I.Ih)(e))})))}})})})})]})}))}}]);
//# sourceMappingURL=9145.2e7a2761.chunk.js.map