2021-09-18 19:29:01 +02:00
|
|
|
import React from "react";
|
2021-03-16 10:42:12 +01:00
|
|
|
|
2021-09-18 19:29:01 +02:00
|
|
|
import { Table, TableCell } from "./Table";
|
|
|
|
import TableBody from "@mui/material/TableBody";
|
|
|
|
import { Table as MuiTable } from "@mui/material";
|
|
|
|
import TableRow from "@mui/material/TableRow";
|
|
|
|
import Typography from "@mui/material/Typography";
|
|
|
|
|
|
|
|
interface IProps {
|
|
|
|
rows: any[][];
|
|
|
|
title?: string;
|
|
|
|
wide?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export function StatsTable({ rows, title, wide }: IProps): React.ReactElement {
|
|
|
|
const T = wide ? MuiTable : Table;
|
2021-09-05 01:09:30 +02:00
|
|
|
return (
|
|
|
|
<>
|
2021-09-18 19:29:01 +02:00
|
|
|
{title && <Typography>{title}</Typography>}
|
|
|
|
<T size="small" padding="none">
|
|
|
|
<TableBody>
|
2021-09-27 02:55:38 +02:00
|
|
|
{rows.map((row: any[], i: number) => (
|
|
|
|
<TableRow key={i}>
|
2021-09-18 19:29:01 +02:00
|
|
|
{row.map((elem: any, i: number) => (
|
|
|
|
<TableCell key={i} align={i !== 0 ? "right" : "left"}>
|
|
|
|
<Typography noWrap>{elem}</Typography>
|
|
|
|
</TableCell>
|
|
|
|
))}
|
|
|
|
</TableRow>
|
|
|
|
))}
|
|
|
|
</TableBody>
|
|
|
|
</T>
|
2021-09-05 01:09:30 +02:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
}
|