import {
displayReportMoney,
type InvestmentReportTable,
} from '@/lib/integral-financial-report';
export function InvestmentReportTables({
tables,
}: {
tables: InvestmentReportTable[];
}) {
return (
{tables.map((table) => (
{table.title}
{table.issues.length > 0 && (
{[...new Set(table.issues)].map((issue) => (
- {issue}
))}
)}
{table.rows.length > 0 && (
{table.title}
{table.headers.map((header, index) => (
|
{header}
|
))}
{table.rows.map((row, i) => (
{row.map((cell, j) =>
j === 0 ? (
|
{cell}
|
) : (
{displayReportMoney(
cell,
)}
|
),
)}
))}
)}
{table.notes.map((note, i) => (
{note}
))}
))}
);
}