import { Dialog, Intent, Switch, ToastPositionSetter, TradingButton, } from '@vegaprotocol/ui-toolkit'; import { useThemeSwitcher } from '@vegaprotocol/react-helpers'; import { useTelemetryApproval } from '../../lib/hooks/use-telemetry-approval'; import { useState, type ReactNode } from 'react'; import classNames from 'classnames'; import { useT } from '../../lib/use-t'; import { useFeatureFlags, type FeatureFlags } from '@vegaprotocol/environment'; export const FeatureFlagSwitch = ({ flag }: { flag: keyof FeatureFlags }) => { const flags = useFeatureFlags((state) => state.flags); const setFeatureFlag = useFeatureFlags((state) => state.setFeatureFlag); return ( setFeatureFlag(flag, !!checked)} checked={flags[flag]} /> ); }; export const Settings = () => { const t = useT(); const { theme, setTheme } = useThemeSwitcher(); const [isApproved, setIsApproved] = useTelemetryApproval(); const [open, setOpen] = useState(false); return (
setTheme()} checked={theme === 'dark'} /> setIsApproved(isOn ? 'true' : 'false')} checked={isApproved === 'true'} /> { setOpen(true); }} > {t('Reset')}

{t( 'You will lose all persisted settings and you will be logged out.' )}

{t('Are you sure you want to reset all settings to default?')}

{ localStorage.clear(); window.location.reload(); }} > {t('Yes, clear cache and refresh')} { setOpen(false); }} > {t('No, keep settings')}
{process.env.GIT_TAG && ( <>
{t('Version')}
{process.env.GIT_TAG}
)}
{t('Git commit hash')}
{process.env.GIT_COMMIT}
); }; const SettingsGroup = ({ label, helpText, children, inline = true, }: { label: string; children: ReactNode; helpText?: string; inline?: boolean; }) => { return (
{label}
{helpText &&

{helpText}

}
{children}
); };