import { useEffect } from "react";
import { bootCookieBanner } from "@/lib/cookie-consent";

/**
 * Boots the vendor cookie banner after hydration. It cannot be a plain <script> in
 * <head>: React's document hydration deletes the vendor's markup from <body>, which
 * left the banner and its settings modal missing on every visit after the first.
 * See src/lib/cookie-consent.ts.
 */
export default function CookieBannerBoot() {
  useEffect(() => {
    void bootCookieBanner();
  }, []);

  return null;
}
