import { BaseModalTitle, BaseModalDescription, } from "#/components/shared/modals/confirmation-modals/base-modal"; import { ModalBackdrop } from "#/components/shared/modals/modal-backdrop"; import { ModalBody } from "#/components/shared/modals/modal-body"; import { useSaveSettings } from "#/hooks/mutation/use-save-settings"; import { handleCaptureConsent } from "#/utils/handle-capture-consent"; import { BrandButton } from "../settings/brand-button"; interface AnalyticsConsentFormModalProps { onClose: () => void; } export function AnalyticsConsentFormModal({ onClose, }: AnalyticsConsentFormModalProps) { const { mutate: saveUserSettings } = useSaveSettings(); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); const formData = new FormData(e.currentTarget); const analytics = formData.get("analytics") === "on"; saveUserSettings( { user_consents_to_analytics: analytics }, { onSuccess: () => { handleCaptureConsent(analytics); onClose(); }, }, ); }; return (
We use tools to understand how our application is used to improve your experience. You can enable or disable analytics. Your preferences will be stored and can be updated anytime. Confirm Preferences
); }