import { Alpine } from "./alpine";
import { applyTheme } from "./theme";

function initRegisterTheme(): void {
  // Progressive enhancement: check localStorage immediately
  const savedTheme = localStorage.getItem("theme");
  if (savedTheme && savedTheme !== "tokyo-night") {
    applyTheme(savedTheme);
  }
}

export { initRegisterTheme };

Alpine.data("register", () => ({
  initRegisterTheme,
}));
