refacto : board player header

This commit is contained in:
GuillaumeSD
2025-05-08 00:43:55 +02:00
parent 8167b9b621
commit 8c934ab3b0
15 changed files with 219 additions and 154 deletions

View File

@@ -1,4 +1,4 @@
import { usePlayersNames } from "@/hooks/usePlayerNames";
import { usePlayersData } from "@/hooks/usePlayerNames";
import { Grid2 as Grid, Typography } from "@mui/material";
import { gameAtom, gameEvalAtom } from "../../../states";
import { MoveClassification } from "@/types/enums";
@@ -6,7 +6,7 @@ import ClassificationRow from "./classificationRow";
import { useAtomValue } from "jotai";
export default function MovesClassificationsRecap() {
const { whiteName, blackName } = usePlayersNames(gameAtom);
const { white, black } = usePlayersData(gameAtom);
const gameEval = useAtomValue(gameEvalAtom);
if (!gameEval?.positions.length) return null;
@@ -29,13 +29,13 @@ export default function MovesClassificationsRecap() {
size={12}
>
<Typography width="12rem" align="center" noWrap fontSize="0.9rem">
{whiteName}
{white.name}
</Typography>
<Typography width="7rem" />
<Typography width="12rem" align="center" noWrap fontSize="0.9rem">
{blackName}
{black.name}
</Typography>
</Grid>