Skip to content

Instantly share code, notes, and snippets.

@imjacobclark
Last active November 29, 2022 12:32
Show Gist options
  • Save imjacobclark/1aba63dbd1bbc17b6cee5a84b0c56630 to your computer and use it in GitHub Desktop.
Save imjacobclark/1aba63dbd1bbc17b6cee5a84b0c56630 to your computer and use it in GitHub Desktop.
type Section = {
title: String;
totals: number[];
total: number;
};
export const BalanceSheetSummarySection = ({
sections,
}: {
sections: Section[];
}) => (
<table className="w-full text-left mt-5">
<InteractiveTableHeader headers={headers} />
<tbody>
{sections.map((section: Section, i: number) => (
<tr key={i}>
<TableItem className="bg-slate-300 font-bold">
{section.title}
</TableItem>
{section.totals.map((total: number, i: number) => (
<TableItem key={i}>{total}</TableItem>
))}
<TableItem className="bg-slate-500 text-right">
{section.total}
</TableItem>
</tr>
))}
</tbody>
</table>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment