From dfec7587305fee59f8304000994ca16a495f7389 Mon Sep 17 00:00:00 2001 From: Tyler Hoang Date: Mon, 29 Jun 2026 01:41:22 -0700 Subject: feat: update financial overview components --- frontend/components/prism/FinancialsCard.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'frontend/components/prism/FinancialsCard.tsx') diff --git a/frontend/components/prism/FinancialsCard.tsx b/frontend/components/prism/FinancialsCard.tsx index 43a2dc2..6e2fe01 100644 --- a/frontend/components/prism/FinancialsCard.tsx +++ b/frontend/components/prism/FinancialsCard.tsx @@ -1,6 +1,7 @@ "use client"; import type { FinancialRow, FinancialsResponse } from "@/types/api"; import { fmtLarge } from "@/lib/format"; +import { CurrencyWarning } from "./CurrencyWarning"; type StatementKey = "income" | "balance" | "cash_flow"; type PeriodKey = "annual" | "quarterly"; @@ -12,13 +13,13 @@ type Props = { onChangePeriod: (p: PeriodKey) => void; }; -function fmtFinVal(val: number | null | undefined, isMargin: boolean): string { +function fmtFinVal(val: number | null | undefined, isMargin: boolean, currency: string): string { if (val === null || val === undefined) return "—"; if (isMargin) return `${(val * 100).toFixed(1)}%`; - return fmtLarge(val); + return fmtLarge(val, currency); } -function FinRow({ row, lastColIdx }: { row: FinancialRow; lastColIdx: number }) { +function FinRow({ row, lastColIdx, currency }: { row: FinancialRow; lastColIdx: number; currency: string }) { if (row.is_section) { return ( @@ -52,7 +53,7 @@ function FinRow({ row, lastColIdx }: { row: FinancialRow; lastColIdx: number }) .filter(Boolean) .join(" ")} > - {fmtFinVal(val, row.is_margin)} + {fmtFinVal(val, row.is_margin, currency)} ))} @@ -92,7 +93,10 @@ export function FinancialsCard({ - + {stmt.columns.map((col, i) => ( {stmt.rows.map((row, i) => ( - + ))}
USD (millions) + {data.currency} (millions) + +
-- cgit v1.3-2-g0d8e