style : add skeletons in analysis body

This commit is contained in:
GuillaumeSD
2025-04-21 23:21:10 +02:00
parent 5cb8d8b384
commit fb88d3b8b2
2 changed files with 49 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
import { Grid2 as Grid, Stack, Typography } from "@mui/material";
import { Grid2 as Grid, Skeleton, Stack, Typography } from "@mui/material";
import { useAtomValue } from "jotai";
import { boardAtom, currentPositionAtom } from "../../states";
import { useMemo } from "react";
@@ -21,7 +21,24 @@ export default function MoveInfo() {
return moveLineUciToSan(lastPosition)(bestMove);
}, [bestMove, board]);
if (!bestMoveSan) return null;
if (board.history().length === 0) return null;
if (!bestMoveSan) {
return (
<Grid size={12} justifyItems="center" alignContent="center">
<Skeleton
variant="rounded"
animation="wave"
width={"12em"}
sx={{ color: "transparent", maxWidth: "7vw", maxHeight: "3.5vw" }}
>
<Typography align="center" fontSize="0.9rem">
placeholder
</Typography>
</Skeleton>
</Grid>
);
}
const moveClassification = position.eval?.moveClassification;
const moveLabel = moveClassification