feat : add stockfish lvl to player label
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user