type Theme = "light" | "dark";
export default function toggleTheme(theme?: Theme) {
  const _html = document.documentElement;

  if (theme === "light" || (!theme && _html.classList.contains("dark"))) {
    _html.classList.remove("dark");
    localStorage.setItem("theme", "lite");
  } else {
    _html.classList.add("dark");
    localStorage.setItem("theme", "dark");
  }
}
