Last active
November 29, 2022 12:32
-
-
Save imjacobclark/1aba63dbd1bbc17b6cee5a84b0c56630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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