diff --git a/src/components/reports/financial/financial-report-client.tsx b/src/components/reports/financial/financial-report-client.tsx index a5107182..a6f3e90d 100644 --- a/src/components/reports/financial/financial-report-client.tsx +++ b/src/components/reports/financial/financial-report-client.tsx @@ -30,6 +30,9 @@ import { rangeToBounds, type DateRange } from '@/lib/analytics/range'; import { apiFetch } from '@/lib/api/client'; import { formatMoney, formatMoneyCompact, formatNumber } 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 { Wallet } from 'lucide-react'; // ─── Payload types (mirror the /api/v1/reports/financial response) ─────────── @@ -119,6 +122,7 @@ interface FinancialPayload { refundLog: RefundRow[]; expenseLedger: ExpenseLedgerRow[]; range: { from: string; to: string }; + hasData: boolean; }; } @@ -138,7 +142,7 @@ const DONUT_COLORS = [ 'hsl(var(--chart-6))', ]; -export function FinancialReportClient({ portSlug: _portSlug }: { portSlug: string }) { +export function FinancialReportClient({ portSlug }: { portSlug: string }) { const searchParams = useSearchParams(); const initialTemplateId = searchParams?.get('templateId') ?? null; @@ -271,6 +275,25 @@ export function FinancialReportClient({ portSlug: _portSlug }: { portSlug: strin const isLoading = query.isLoading || !kpis; + if (!query.isLoading && d && !d.hasData) { + return ( +
+ + +
+ ); + } + return (
+ + +
+ ); + } + return (