From 24e88ae32edbac6371740125a3b7e9a288c284da Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 2 Jun 2026 10:17:56 +0200 Subject: [PATCH] feat(reports): sales report-level empty state Co-Authored-By: Claude Opus 4.8 (1M context) --- .../reports/sales/sales-report-client.tsx | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/src/components/reports/sales/sales-report-client.tsx b/src/components/reports/sales/sales-report-client.tsx index de24e7ac..78316242 100644 --- a/src/components/reports/sales/sales-report-client.tsx +++ b/src/components/reports/sales/sales-report-client.tsx @@ -36,6 +36,8 @@ import { } from '@/lib/constants'; import { formatMoney } from '@/lib/reports/format-currency'; import type { ReportPayload } from '@/lib/reports/types'; +import { ReportEmptyState } from '@/components/reports/shared/report-empty-state'; +import type { Route } from 'next'; import { SalesPipelineFunnel } from './sales-pipeline-funnel'; import { SalesStageVelocity } from './sales-stage-velocity'; @@ -211,6 +213,7 @@ interface SalesReportPayload { recentWins: RecentWinRow[]; lostReasonBreakdown: LostReasonRow[]; range: { from: string; to: string }; + hasData: boolean; }; } @@ -274,7 +277,7 @@ interface SalesTemplateConfig extends Record { compare?: boolean; } -export function SalesReportClient({ portSlug: _portSlug }: { portSlug: string }) { +export function SalesReportClient({ portSlug }: { portSlug: string }) { const searchParams = useSearchParams(); const initialTemplateId = searchParams?.get('templateId') ?? null; @@ -345,6 +348,7 @@ export function SalesReportClient({ portSlug: _portSlug }: { portSlug: string }) }); const kpis = query.data?.data.kpis; + const data = query.data?.data; const deltas = query.data?.data.comparison?.deltas ?? null; const funnel = query.data?.data.funnel ?? []; const stageVelocity = query.data?.data.stageVelocity ?? []; @@ -594,6 +598,25 @@ export function SalesReportClient({ portSlug: _portSlug }: { portSlug: string }) }; } + if (!query.isLoading && data && !data.hasData) { + return ( +
+ + +
+ ); + } + return (