Skip to content
This repository was archived by the owner on Aug 6, 2026. It is now read-only.

Commit 72c36a4

Browse files
authored
fix(usage): clarify spend summary window
Generated-By: PostHog Code Task-Id: 35976f6d-329c-4b2e-9e38-cdeec8968ea1
1 parent 0cbc64f commit 72c36a4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

packages/ui/src/features/usage/components/SpendKpiStrip.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {
22
formatUsd,
3+
formatWindow,
34
type SpendAnalysisFilledDay,
45
windowDays,
56
} from "@posthog/core/billing/spendAnalysisFormat";
@@ -41,6 +42,7 @@ export function SpendKpiStrip({ data, filledDays }: SpendKpiStripProps) {
4142
const costSeries = filledDays?.map((d) => Math.max(0, d.cost_usd));
4243
const eventSeries = filledDays?.map((d) => d.event_count);
4344
const latestDay = filledDays?.at(-1);
45+
const windowLabel = formatWindow(summary.date_from, summary.date_to);
4446

4547
return (
4648
<Flex className="overflow-hidden rounded-(--radius-3) border border-(--gray-5) bg-(--color-panel-solid)">
@@ -64,6 +66,7 @@ export function SpendKpiStrip({ data, filledDays }: SpendKpiStripProps) {
6466
formatValue={formatUsd}
6567
change={null}
6668
subtitle={costSeries ? undefined : `${codeShare}% of total`}
69+
restingSubtitle={windowLabel}
6770
sparklineHeight={28}
6871
/>
6972
</KpiCell>
@@ -76,6 +79,7 @@ export function SpendKpiStrip({ data, filledDays }: SpendKpiStripProps) {
7679
theme={theme}
7780
formatValue={(v) => v.toLocaleString()}
7881
change={null}
82+
restingSubtitle={windowLabel}
7983
sparklineHeight={28}
8084
/>
8185
</KpiCell>

0 commit comments

Comments
 (0)