refacto : global refacto

This commit is contained in:
GuillaumeSD
2024-02-22 23:18:02 +01:00
parent 2a74b62bae
commit 2af0959e82
24 changed files with 230 additions and 190 deletions

View File

@@ -0,0 +1,22 @@
import { LineEval } from "@/types/eval";
import { ListItem, ListItemText, Typography } from "@mui/material";
interface Props {
line: LineEval;
}
export default function LineEvaluation({ line }: Props) {
const lineLabel =
line.cp !== undefined
? `${line.cp / 100}`
: line.mate
? `Mate in ${Math.abs(line.mate)}`
: "?";
return (
<ListItem disablePadding>
<ListItemText primary={lineLabel} sx={{ marginRight: 2 }} />
<Typography>{line.pv.slice(0, 7).join(", ")}</Typography>
</ListItem>
);
}