import { Toggle } from 'ui' import { toast } from 'sonner' import { useConsentState } from 'common' import Panel from 'components/ui/Panel' import { useSendResetMutation } from 'data/telemetry/send-reset-mutation' export const AnalyticsSettings = () => { const { hasAccepted, acceptAll, denyAll, categories } = useConsentState() const hasLoaded = categories !== null const { mutate: sendReset } = useSendResetMutation() const onToggleOptIn = () => { if (!hasLoaded) { toast.error( "We couldn't load the privacy settings due to an ad blocker or network error. Please disable any ad blockers and try again. If the problem persists, please contact support." ) return } if (hasAccepted) { denyAll() sendReset() } else { acceptAll() } } return ( Analytics and Marketing}> ) }