"use client"; import { useEffect } from "react"; import { refFromQuery, rememberRef } from "@/app/lib/referral"; /** Mounted once at the app root: on initial page load, if the URL carries a * `?ref=` referral code, persist it so it survives a bounce to /login and the * login→register navigation. Renders nothing. */ export default function ReferralCapture() { useEffect(() => { const ref = refFromQuery(); if (ref) rememberRef(ref); }, []); return null; }