"use client"; import { cn } from "@/lib/utils"; import type { DetailFinancialRow, DimensionBreakdownRow, FinancialStatementPeriod, FinancialSurfaceKind, SurfaceFinancialRow, } from "@/lib/types"; import type { ResolvedStatementSelection } from "@/lib/financials/statement-view-model"; type StatementRowInspectorProps = { selection: ResolvedStatementSelection | null; dimensionRows: DimensionBreakdownRow[]; periods: FinancialStatementPeriod[]; surfaceKind: Extract< FinancialSurfaceKind, | "income_statement" | "balance_sheet" | "cash_flow_statement" | "equity_statement" | "disclosures" >; renderValue: ( row: SurfaceFinancialRow | DetailFinancialRow, periodId: string, previousPeriodId: string | null, ) => string; renderDimensionValue: ( value: number | null, rowKey: string, unit: SurfaceFinancialRow["unit"], ) => string; showHeader?: boolean; className?: string; }; function InspectorField(props: { label: string; value: string }) { return (
{props.label}
{props.value}
Inspect compact-surface resolution, raw drill-down rows, and dimensional evidence.
Select a compact surface row or raw detail row to inspect details.
) : selection.kind === "surface" ? (Raw Detail Labels
No dimensional facts were returned for the selected compact row.
) : (| Period | Axis | Member | Value |
|---|---|---|---|
| {props.periods.find( (period) => period.id === row.periodId, )?.periodLabel ?? row.periodId} | {row.axis} | {row.member} | {props.renderDimensionValue( row.value, selection.row.key, selection.row.unit, )} |
No dimensional drill-down is available for this compact surface row.
)}No dimensional facts were returned for the selected raw detail row.
) : (| Period | Axis | Member | Value |
|---|---|---|---|
| {props.periods.find( (period) => period.id === row.periodId, )?.periodLabel ?? row.periodId} | {row.axis} | {row.member} | {props.renderDimensionValue( row.value, selection.row.key, props.surfaceKind === "balance_sheet" ? "currency" : "currency", )} |