"use client"; import type { FinancialRow, FinancialsResponse } from "@/types/api"; import { fmtLarge } from "@/lib/format"; type StatementKey = "income" | "balance" | "cash_flow"; type PeriodKey = "annual" | "quarterly"; type Props = { data: FinancialsResponse; statement: StatementKey; period: PeriodKey; onChangePeriod: (p: PeriodKey) => void; }; function fmtFinVal(val: number | null | undefined, isMargin: boolean): string { if (val === null || val === undefined) return "—"; if (isMargin) return `${(val * 100).toFixed(1)}%`; return fmtLarge(val); } function FinRow({ row, lastColIdx }: { row: FinancialRow; lastColIdx: number }) { if (row.is_section) { return (
Statement data unavailable.
) : (| USD (millions) | {stmt.columns.map((col, i) => ({col} | ))}
|---|