Skip to content

Commit f350ec3

Browse files
talissoncostaclaude
andcommitted
fix(usage): show an empty state when a period has no usage
UsageOverTime returned null, so a new organisation, or the project filter pointed at a project with no traffic, saw a meter and then blank space. The page this replaces already handled it; the copy is taken from there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 696cce5 commit f350ec3

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

frontend/web/components/organisation-settings/usage/UsageOverTime/UsageOverTime.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { FC, useMemo } from 'react'
22
import { Res } from 'common/types/responses'
33
import { colorSurfaceAction } from 'common/theme/tokens'
4+
import EmptyState from 'components/EmptyState'
45
import BarChart from 'components/charts/BarChart'
56
import LineChart from 'components/charts/LineChart'
67
import {
@@ -30,10 +31,6 @@ const UsageOverTime: FC<UsageOverTimeProps> = ({
3031

3132
const cumulative = useMemo(() => cumulativeTotals(daily), [daily])
3233

33-
if (!daily.length) {
34-
return null
35-
}
36-
3734
const xAxisInterval = xAxisIntervalFor(daily.length)
3835

3936
const chart = isBillingPeriod ? (
@@ -71,7 +68,15 @@ const UsageOverTime: FC<UsageOverTimeProps> = ({
7168
: 'Per day · rolling window'}
7269
</span>
7370
</div>
74-
{chart}
71+
{daily.length ? (
72+
chart
73+
) : (
74+
<EmptyState
75+
title='No usage recorded'
76+
description='No usage data available for the selected period and project.'
77+
icon='bar-chart'
78+
/>
79+
)}
7580
</div>
7681
)
7782
}

0 commit comments

Comments
 (0)