bitburner-src/src/PersonObjects/Sleeve/ui/EarningsTableElement.tsx

29 lines
686 B
TypeScript
Raw Normal View History

import * as React from "react";
2021-09-09 05:47:34 +02:00
export function EarningsTableElement(title: string, stats: any[][]): React.ReactElement {
2021-09-05 01:09:30 +02:00
return (
<>
<pre>{title}</pre>
<table>
<tbody>
{stats.map((stat: any[], i: number) => (
<tr key={i}>
{stat.map((s: any, i: number) => {
let style = {};
if (i !== 0) {
style = { textAlign: "right" };
}
return (
<td style={style} key={i}>
{s}
</td>
);
})}
</tr>
))}
</tbody>
</table>
</>
);
}