refacto : board player header
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user