Skip to content

Instantly share code, notes, and snippets.

@salemhilal
Created February 17, 2023 20:03
Show Gist options
  • Save salemhilal/1bf692b56de448b0dd4c5589eb5746d9 to your computer and use it in GitHub Desktop.
Save salemhilal/1bf692b56de448b0dd4c5589eb5746d9 to your computer and use it in GitHub Desktop.
diff --git a/src/components/hosted_page/cards/UsageCard.tsx b/src/components/hosted_page/cards/UsageCard.tsx
index ed8881c2..d35aa662 100644
--- a/src/components/hosted_page/cards/UsageCard.tsx
+++ b/src/components/hosted_page/cards/UsageCard.tsx
@@ -175,11 +175,7 @@ export const UsageCard = ({ usageData }: Props) => {
data={rows}
columns={[{ accessor: 'value' }]}
formatTooltipValue={(value) =>
- `${value}${
- meterData?.unitName
- ? ` ${pluralize(meterData.unitName, value)}`
- : null
- }`
+ `${value}${` ${pluralize(meterData?.unitName ?? 'unit', value)}`}`
}
/>
</Box>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment