Files
chesskit/src/sections/engineSettings/arrowOptions.tsx
2024-02-25 18:34:11 +01:00

44 lines
1.1 KiB
TypeScript

import { Checkbox, FormControlLabel, Grid } from "@mui/material";
import { useAtom } from "jotai";
import {
showBestMoveArrowAtom,
showPlayerMoveArrowAtom,
} from "../analysis/states";
export default function ArrowOptions() {
const [showBestMove, setShowBestMove] = useAtom(showBestMoveArrowAtom);
const [showPlayerMove, setShowPlayerMove] = useAtom(showPlayerMoveArrowAtom);
return (
<Grid
container
item
justifyContent="space-evenly"
alignItems="center"
xs={12}
gap={3}
>
<FormControlLabel
control={
<Checkbox
checked={showBestMove}
onChange={(_, checked) => setShowBestMove(checked)}
/>
}
label="Show best move green arrow"
sx={{ marginX: 0 }}
/>
<FormControlLabel
control={
<Checkbox
checked={showPlayerMove}
onChange={(_, checked) => setShowPlayerMove(checked)}
/>
}
label="Show player move yellow arrow"
sx={{ marginX: 0 }}
/>
</Grid>
);
}