"use client"

import { useEffect } from "react"

/** Landing toujours en thème système, indépendamment des réglages Ultimail. */
export function LandingThemeApplier() {
  useEffect(() => {
    const media = window.matchMedia("(prefers-color-scheme: dark)")

    const apply = () => {
      document.documentElement.classList.toggle("dark", media.matches)
    }

    apply()
    media.addEventListener("change", apply)
    return () => media.removeEventListener("change", apply)
  }, [])

  return null
}
