import { Divider, List, Switch } from '@mui/material'; import { useTranslation } from 'react-i18next'; import { ListItem, ListItemText } from '@/components/ListItem'; import { usePreferenceObservable } from '@services/preferences/hooks'; import { Paper, SectionTitle } from '../PreferenceComponents'; import type { ISectionProps } from '../useSections'; export function Performance(props: Required): React.JSX.Element { const { t } = useTranslation(); const preference = usePreferenceObservable(); return ( <> {t('Preference.Performance')} {preference === undefined ? {t('Loading')} : ( <> { await window.service.preference.set('hibernateUnusedWorkspacesAtLaunch', event.target.checked); }} /> } > { await window.service.preference.set('useHardwareAcceleration', event.target.checked); props.requestRestartCountDown(); }} /> } > )} ); }