import { useId } from "react"; import { ChartNoAxesColumn } from "lucide-react"; import type { BrowserAnalyticsConfig } from "@paperclipai/shared"; import { ToggleSwitch } from "@/components/ui/toggle-switch"; import { browserBlocksAnalytics, storeAnalyticsChoice, useAnalyticsConsent } from "@/lib/analytics/consent"; import { PRIVACY_POLICY_URL } from "./AnalyticsConsentBanner"; export function ProductAnalyticsSetting({ config }: { config: BrowserAnalyticsConfig | null | undefined }) { const consent = useAnalyticsConsent(config ?? null); const labelId = useId(); const descriptionId = useId(); if (!config || !consent) return null; const blocked = browserBlocksAnalytics(config); return (

Product analytics

{config.replayEnabled ? "Share usage analytics and session recordings from this browser to help improve Paperclip. Recordings hide what you type and your messages, documents and connected accounts, but may show page names like task titles. " : "Share usage analytics from this browser to help improve Paperclip. "} {blocked ? "Your browser asks sites not to track you, so analytics stays off. " : null} Privacy policy

storeAnalyticsChoice(checked ? "granted" : "denied")} aria-labelledby={labelId} aria-describedby={descriptionId} />
); }