import { Popover, ActionIcon, Fieldset, Checkbox, Stack, Group, NumberInput, } from "@mantine/core"; import { IconSettings } from "@tabler/icons-react"; import { FC } from "react"; import { useAppDispatch } from "../state/hooks"; import { updateSettings, useSettings } from "../state/settingsSlice"; import { actionIconStyle } from "../styles"; const SettingsMenu: FC = () => { const { useLocalTime, enableQueryHistory, enableAutocomplete, enableSyntaxHighlighting, enableLinter, showAnnotations, ruleGroupsPerPage, alertGroupsPerPage, } = useSettings(); const dispatch = useAppDispatch(); return (
dispatch( updateSettings({ useLocalTime: event.currentTarget.checked, }) ) } />
dispatch( updateSettings({ enableQueryHistory: event.currentTarget.checked, }) ) } /> dispatch( updateSettings({ enableAutocomplete: event.currentTarget.checked, }) ) } /> dispatch( updateSettings({ enableSyntaxHighlighting: event.currentTarget.checked, }) ) } /> dispatch( updateSettings({ enableLinter: event.currentTarget.checked, }) ) } />
dispatch( updateSettings({ showAnnotations: event.currentTarget.checked, }) ) } />
{ if (typeof value !== "number") { return; } dispatch( updateSettings({ alertGroupsPerPage: value, }) ); }} />
{ if (typeof value !== "number") { return; } dispatch( updateSettings({ ruleGroupsPerPage: value, }) ); }} />
); }; export default SettingsMenu;