"use strict";(self.webpackChunkportal_ui=self.webpackChunkportal_ui||[]).push([[9145],{59145:function(e,n,t){t.r(n),t.d(n,{default:function(){return N}});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(75952),b=t(27454),Z=t(80184),j=(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,Z.jsx)(v.Z,{className:t&&t.subnet_license?n.licenseContainer:"",children:t&&t.subnet_license?(0,Z.jsx)(o.Fragment,{children:(0,Z.jsxs)(r.ZP,{container:!0,className:n.licenseInfo,children:[(0,Z.jsxs)(r.ZP,{item:!0,xs:6,children:[(0,Z.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"License"}),(0,Z.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:"Commercial License"}),(0,Z.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Organization"}),(0,Z.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:t.subnet_license.organization}),(0,Z.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Registered Capacity"}),(0,Z.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,Z.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Expiry Date"}),(0,Z.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:(0,Z.jsx)(x(),{format:"YYYY-MM-DD",children:t.subnet_license.expires_at})})]}),(0,Z.jsxs)(r.ZP,{item:!0,xs:6,children:[(0,Z.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Subscription Plan"}),(0,Z.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:t.subnet_license.plan}),(0,Z.jsx)(f.Z,{variant:"button",display:"block",gutterBottom:!0,className:n.licenseInfoTitle,children:"Requestor"}),(0,Z.jsx)(f.Z,{variant:"overline",display:"block",gutterBottom:!0,className:n.licenseInfoValue,children:t.subnet_license.email})]}),(0,Z.jsx)("img",{className:n.verifiedIcon,src:"/verified.svg",alt:"verified"})]})}):!a&&(0,Z.jsxs)(r.ZP,{className:n.paperContainer,children:[!s&&(0,Z.jsx)(h.rU,{to:"/license",onClick:function(e){e.stopPropagation()},className:n.noUnderLine,children:(0,Z.jsx)(b.Z,{tooltip:"Activate Product",children:(0,Z.jsx)(g.z,{id:"activate-product",label:"Activate Product",onClick:function(){return!1},variant:"callAction"})})}),s&&t&&(0,Z.jsx)(b.Z,{tooltip:"Attach License",children:(0,Z.jsx)(g.z,{id:"attach-license",disabled:i,label:"Attach License",onClick:function(){return c(t.namespace,t.name)},variant:"callAction"})})]})})})),F=t(81207),I=t(72401),k=t(87995),B=t(17238),N=(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),b=(0,i.Z)(g,2),N=b[0],y=b[1];return(0,o.useEffect)((function(){h&&F.Z.invoke("GET","/api/v1/subscription/info").then((function(e){p(e),v(!1)})).catch((function(e){v(!1)}))}),[h]),(0,Z.jsxs)(o.Fragment,{children:[(0,Z.jsx)("h1",{className:n.sectionTitle,children:"License"}),a?(0,Z.jsx)("div",{className:n.loaderAlign,children:(0,Z.jsx)(I.Z,{})}):(0,Z.jsx)(o.Fragment,{children:c&&(0,Z.jsx)(r.ZP,{container:!0,children:(0,Z.jsx)(r.ZP,{item:!0,xs:12,children:(0,Z.jsx)(j,{tenant:c,loadingLicenseInfo:h,loadingActivateProduct:N,licenseInfo:f,activateProduct:function(e,n){N||(y(!0),F.Z.invoke("POST","/api/v1/subscription/namespaces/".concat(e,"/tenants/").concat(n,"/activate"),{}).then((function(){y(!1),t((0,B.V2)(!0)),v(!0)})).catch((function(e){y(!1),t((0,k.Ih)(e))})))}})})})})]})}))}}]);
//# sourceMappingURL=9145.0a0554bf.chunk.js.map