diff --git a/src/components/dashboard/ServiceCard.tsx b/src/components/dashboard/ServiceCard.tsx index 1d961c0..8cc94c0 100644 --- a/src/components/dashboard/ServiceCard.tsx +++ b/src/components/dashboard/ServiceCard.tsx @@ -23,7 +23,25 @@ function normalizeServiceName(name: string): string { .replace(/\b\w/g, (s) => s.toUpperCase()); } -function TenantsStatusTooltip(tenantsStatus: StatusPerTenant) {} +interface TenantsStatusTooltipProps { + tenantsStatus: StatusPerTenant; +} + +function TenantsStatusTooltip({ tenantsStatus }: TenantsStatusTooltipProps) { + const statusItems = Object.entries(tenantsStatus).map(([key, value]) => { + console.log(`key: ${key}, value: ${value}`); + return null; + }); + // console.log(tenantsStatus); + // console.log(statusItems); + + return ( + + Tooltip with HTML + {"And here's"} {"some"} {"amazing content"}. {"It's very engaging. Right?"} + + ); +} interface ServiceNodePropps { node: Node; @@ -45,31 +63,28 @@ function ServiceNode({ node }: ServiceNodePropps) { tenantsHealth = Object.values(node.health_check_status?.status_per_tenant); } - let tenantsStatus = null; + let tenantsStatusContent = null; if (tenantsHealth.length > 0) { const okValues = tenantsHealth.filter((t) => t === true); switch (okValues.length) { case 0: - tenantsStatus = ( - - Tooltip with HTML - {"And here's"} {"some"} {"amazing content"}.{" "} - {"It's very engaging. Right?"} - - } - > - - - ); + tenantsStatusContent = ; break; case tenantsHealth.length: - tenantsStatus = ; + tenantsStatusContent = ; break; default: - tenantsStatus = ; + tenantsStatusContent = ; + } + + if (node.health_check_status?.status_per_tenant) { + tenantsStatusContent = ( + }> + {tenantsStatusContent} + + ); + } else { } } @@ -85,7 +100,7 @@ function ServiceNode({ node }: ServiceNodePropps) { - {tenantsStatus} + {tenantsStatusContent} ); diff --git a/src/scss/_service-card.scss b/src/scss/_service-card.scss index 7c97f47..2dbc5da 100644 --- a/src/scss/_service-card.scss +++ b/src/scss/_service-card.scss @@ -43,6 +43,10 @@ $color-danger: #d32f2f; } } } + + .MuiCardContent-root { + padding-bottom: 16px !important; + } } .MuiTooltip-tooltip .tenants-status-tooltip {