@growth-operations/ui-shared 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@growth-operations/ui-shared",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Shared HubSpot UI-extension modules (Home, Billing) for Growth Operations apps.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -87,8 +87,12 @@ export function UsageTab({
87
87
 
88
88
  const series = data?.series ?? [];
89
89
  const usedInWindow = data?.used_in_window ?? 0;
90
- const remaining = data?.remaining ?? 0;
91
- const granted = data?.granted ?? 0;
90
+ // Legacy (Anvil) installs have no credit balance — the backend returns null
91
+ // granted/remaining. Show only the window usage stat for them; credit installs
92
+ // get the full granted/remaining breakdown.
93
+ const remaining = data?.remaining;
94
+ const granted = data?.granted;
95
+ const hasBalance = remaining != null && granted != null;
92
96
  const hasActivity = usedInWindow > 0;
93
97
 
94
98
  return (
@@ -106,9 +110,9 @@ export function UsageTab({
106
110
 
107
111
  <Tile>
108
112
  <Statistics>
109
- <StatisticsItem label="Credits used (window)" number={usedInWindow} />
110
- <StatisticsItem label="Remaining" number={remaining} />
111
- <StatisticsItem label="Granted" number={granted} />
113
+ <StatisticsItem label="Used (window)" number={usedInWindow} />
114
+ {hasBalance && <StatisticsItem label="Remaining" number={remaining} />}
115
+ {hasBalance && <StatisticsItem label="Granted" number={granted} />}
112
116
  </Statistics>
113
117
  </Tile>
114
118