feat : eval bar value on win percentage

This commit is contained in:
GuillaumeSD
2024-03-07 22:50:06 +01:00
parent e47ce83ebe
commit a10b9c0482
4 changed files with 26 additions and 28 deletions

View File

@@ -25,9 +25,9 @@ export default function EvaluationBar({ height }: Props) {
useEffect(() => {
const bestLine = position?.eval?.lines[0];
if (!bestLine || bestLine.depth < 6) return;
if (!position.eval || !bestLine || bestLine.depth < 6) return;
const evalBar = getEvaluationBarValue(bestLine, isWhiteToPlay);
const evalBar = getEvaluationBarValue(position.eval);
setEvalBar(evalBar);
}, [position, isWhiteToPlay]);

View File

@@ -40,8 +40,10 @@ const SquareRenderer = forwardRef<HTMLDivElement, CustomSquareProps>(
height={40}
style={{
position: "absolute",
top: -15,
right: -15,
top: "max(-15px, -1.8vw)",
right: "max(-15px, -1.8vw)",
maxWidth: "3.6vw",
maxHeight: "3.6vw",
}}
/>
)}