import Slider from "@/components/slider"; import { EngineName } from "@/types/enums"; import { MenuItem, Select, Button, Dialog, DialogTitle, DialogContent, FormControl, InputLabel, OutlinedInput, DialogActions, Typography, Grid2 as Grid, } from "@mui/material"; import { engineNameAtom, engineDepthAtom, engineMultiPvAtom, } from "../analysis/states"; import ArrowOptions from "./arrowOptions"; import { useAtomLocalStorage } from "@/hooks/useAtomLocalStorage"; import { useEffect } from "react"; import { isWasmSupported } from "@/lib/engine/shared"; interface Props { open: boolean; onClose: () => void; } export default function EngineSettingsDialog({ open, onClose }: Props) { const [depth, setDepth] = useAtomLocalStorage( "engine-depth", engineDepthAtom ); const [multiPv, setMultiPv] = useAtomLocalStorage( "engine-multi-pv", engineMultiPvAtom ); const [engineName, setEngineName] = useAtomLocalStorage( "engine-name", engineNameAtom ); useEffect(() => { if (!isWasmSupported()) { setEngineName(EngineName.Stockfish11); } }, [setEngineName]); return ( Set engine parameters Stockfish 16.1 Lite is the default engine. It offers the best balance between speed and strength. Stockfish 16.1 is the strongest engine available, note that it requires a one time download of 64MB. Engine ); } const engineLabel: Record = { [EngineName.Stockfish16_1]: "Stockfish 16.1 (64MB)", [EngineName.Stockfish16_1Lite]: "Stockfish 16.1 Lite (6MB)", [EngineName.Stockfish16NNUE]: "Stockfish 16 (40MB)", [EngineName.Stockfish16]: "Stockfish 16 Lite (HCE)", [EngineName.Stockfish11]: "Stockfish 11", };