import { useTranslation } from "react-i18next"; import { Button, ButtonGroup, Tooltip } from "@mui/material"; import { checkService } from "@/services/cmds"; import { useVerge } from "@/hooks/use-verge"; import getSystem from "@/utils/get-system"; import useSWR from "swr"; const isWIN = getSystem() === "windows"; interface Props { value?: string; onChange?: (value: string) => void; } export const StackModeSwitch = (props: Props) => { const { value, onChange } = props; const { verge } = useVerge(); const { enable_service_mode } = verge ?? {}; // service mode const { data: serviceStatus } = useSWR( isWIN ? "checkService" : null, checkService, { revalidateIfStale: false, shouldRetryOnError: false, } ); const { t } = useTranslation(); return ( ); };