"use client"; import React, { useEffect, useRef, useState } from "react"; import Link from "next/link"; import { Cookie } from "lucide-react"; import { getConsent, setConsent } from "@/lib/analytics"; /** * Asks once whether we may use a cookie-like identifier to count visits (our own * registration-funnel stats). Declining changes nothing else about the site. */ export function CookieConsent() { const [show, setShow] = useState(false); const ref = useRef(null); useEffect(() => { setShow(getConsent() === null); }, []); // Publishes the banner's height as --cookie-banner-h so HelpFab can sit above it. useEffect(() => { const el = ref.current; if (!show || !el) return; const root = document.documentElement; const update = () => root.style.setProperty("--cookie-banner-h", `${el.offsetHeight}px`); update(); const ro = new ResizeObserver(update); ro.observe(el); return () => { ro.disconnect(); root.style.removeProperty("--cookie-banner-h"); }; }, [show]); if (!show) return null; const choose = (v: "accepted" | "declined") => { setConsent(v); setShow(false); }; return ( // On mobile, sit above BottomNav (fixed, h-16 + safe-area, z-50).

May we count your visit? We use our own anonymous statistics (no third-party analytics) to see how people find and register for events.{" "} Privacy policy

); }