Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: filter out empty egress breakdown items

Kevin Grüneberg49c7ccd6104a
diff --git a/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx b/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx
index aa2b3697f80..6a0a5680f45 100644
--- a/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx
+++ b/studio/components/interfaces/Organization/Usage/UsageChartTooltips.tsx
@@ -81,15 +81,22 @@ export const MultiAttributeTooltipContent = ({
<p className="text-scale-1000 text-lg">No data yet</p>
) : (
<div className="space-y-1 pb-1">
- {attributes.map((attr) => (
- <AttributeContent
- key={attr.name}
- attribute={attr}
- attributeMeta={values.find((x) => x.dataKey === attr.key)}
- sumValue={sumValue}
- tooltipFormatter={tooltipFormatter}
- />
- ))}
+ {attributes.flatMap((attr) => {
+ const attributeMeta = values.find((x) => x.dataKey === attr.key)
+
+ // Filter out empty attributes
+ if (Number(attributeMeta?.value ?? 0) === 0) return []
+
+ return (
+ <AttributeContent
+ key={attr.name}
+ attribute={attr}
+ attributeMeta={attributeMeta}
+ sumValue={sumValue}
+ tooltipFormatter={tooltipFormatter}
+ />
+ )
+ })}
</div>
)}
</>