@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 +1 -1
- package/src/usage/UsageTab.jsx +9 -5
package/package.json
CHANGED
package/src/usage/UsageTab.jsx
CHANGED
|
@@ -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
|
-
|
|
91
|
-
|
|
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="
|
|
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
|
|