import { useEffect } from "react";
import { useNetlifySDK } from "../use_netlify_sdk.js";
const THEME_DARK_MODE_CLASS = "tw-dark";
var ThemePreference = /* @__PURE__ */ ((ThemePreference2) => {
  ThemePreference2["Light"] = "light";
  ThemePreference2["Dark"] = "dark";
  return ThemePreference2;
})(ThemePreference || {});
const setThemeOnDom = (theme) => {
  if (theme === "dark") {
    document.documentElement.classList.add(THEME_DARK_MODE_CLASS);
  } else {
    document.documentElement.classList.remove(THEME_DARK_MODE_CLASS);
  }
};
function Theme() {
  const sdk = useNetlifySDK();
  useEffect(() => {
    setThemeOnDom(sdk.context.theme);
  }, [sdk.context.theme]);
  return null;
}
export {
  THEME_DARK_MODE_CLASS,
  Theme,
  ThemePreference,
  setThemeOnDom
};
//# sourceMappingURL=Theme.js.map
