fix json types
This commit is contained in:
parent
1d945977dc
commit
fc073de1de
@ -1,4 +1,3 @@
|
|||||||
import * as React from "react";
|
|
||||||
import Table from "@mui/material/Table";
|
import Table from "@mui/material/Table";
|
||||||
import TableBody from "@mui/material/TableBody";
|
import TableBody from "@mui/material/TableBody";
|
||||||
import TableCell from "@mui/material/TableCell";
|
import TableCell from "@mui/material/TableCell";
|
||||||
@ -8,12 +7,14 @@ import TableRow from "@mui/material/TableRow";
|
|||||||
import Paper from "@mui/material/Paper";
|
import Paper from "@mui/material/Paper";
|
||||||
import data from "./table.json";
|
import data from "./table.json";
|
||||||
|
|
||||||
|
type Row = [player: string, fulfilled: number, total: number];
|
||||||
|
|
||||||
export default function TeamTables() {
|
export default function TeamTables() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{Object.keys(data).map((teamname) => (
|
{Object.entries(data).map(([teamname, rows]) => (
|
||||||
<>
|
<>
|
||||||
<h1>{teamname as String}</h1>
|
<h1>{teamname}</h1>
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table
|
<Table
|
||||||
sx={{ m: "8px auto" }}
|
sx={{ m: "8px auto" }}
|
||||||
@ -27,7 +28,7 @@ export default function TeamTables() {
|
|||||||
</TableRow>
|
</TableRow>
|
||||||
</TableHead>
|
</TableHead>
|
||||||
<TableBody>
|
<TableBody>
|
||||||
{data[teamname].map((row) => (
|
{(rows as Row[]).map((row: Row) => (
|
||||||
<TableRow
|
<TableRow
|
||||||
key={row[0]}
|
key={row[0]}
|
||||||
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
|
sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
|
||||||
|
Loading…
Reference in New Issue
Block a user