mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
+36
-20
@@ -1,24 +1,40 @@
|
||||
import * as React from "react";
|
||||
|
||||
export function StatsTable(rows: any[][], title?: string): 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', paddingLeft: '.25em'};
|
||||
return <td key={i} style={style}>{elem}</td>
|
||||
})}
|
||||
</tr>
|
||||
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", paddingLeft: ".25em" };
|
||||
return (
|
||||
<td key={i} style={style}>
|
||||
{elem}
|
||||
</td>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</>);
|
||||
}
|
||||
</tr>
|
||||
);
|
||||
})}
|
||||
</tbody>
|
||||
</table>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user