"use client";

import { loadChartAppearancePreference } from "@/lib/chart/chart-appearance-storage";
import { useEffect } from "react";

/** Applies saved portal theme before the chart mounts. */
export function PortalThemeBootstrap() {
  useEffect(() => {
    const { themeId } = loadChartAppearancePreference();
    document.body.classList.toggle("tb-app-light", themeId === "light");
    document.body.classList.toggle("tb-app-dark", themeId !== "light");
  }, []);
  return null;
}
