mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
Sleeve UI improvements.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import * as React from "react";
|
||||
|
||||
export function StatsTable(rows: any[][], title: string | null): React.ReactElement {
|
||||
let titleElem = <></>
|
||||
if (title) {
|
||||
titleElem = <><h2><u>{title}</u></h2><br /></>;
|
||||
}
|
||||
return (<>
|
||||
{titleElem}
|
||||
<table>
|
||||
<tbody>
|
||||
{rows.map((row: any[]) => {
|
||||
return <tr key={row[0]}>
|
||||
{row.map((elem: any, i: number) => {
|
||||
let style = {};
|
||||
if (i !== 0) style = {textAlign: 'right'};
|
||||
return <td key={i} style={style}>{elem}</td>
|
||||
})}
|
||||
</tr>
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</>);
|
||||
}
|
||||
Reference in New Issue
Block a user