feat : add stockfish lvl to player label

This commit is contained in:
GuillaumeSD
2024-03-21 18:31:33 +01:00
parent 1f6c86f559
commit 8355dbc4e8

View File

@@ -1,6 +1,6 @@
import { Grid, Typography } from "@mui/material";
import { useAtomValue } from "jotai";
import { playerColorAtom } from "../states";
import { engineSkillLevelAtom, playerColorAtom } from "../states";
import { Color } from "@/types/enums";
interface Props {
@@ -9,8 +9,10 @@ interface Props {
export default function PlayerInfo({ color }: Props) {
const playerColor = useAtomValue(playerColorAtom);
const skillLevel = useAtomValue(engineSkillLevelAtom);
const playerName = playerColor === color ? "You 🧠" : "Stockfish 🤖";
const playerName =
playerColor === color ? "You 🧠" : `Stockfish level ${skillLevel} 🤖`;
return (
<Grid item container xs={12} justifyContent="center" alignItems="center">