import React, { useEffect, useState } from "react"; import { IconButton } from "@mui/material"; import SunAndMoonIcon from "./SunAndMoonIcon"; import "./index.css"; const ThemeSwitch = () => { // TODO: change to use the MUI theme const [currentTheme, setCurrentTheme] = useState("light"); const toggleTheme = () => setCurrentTheme((prevState) => (prevState === "light" ? "dark" : "light")); useEffect(() => { document.body.setAttribute("data-theme", currentTheme); }, [currentTheme]); return ( ); }; export default ThemeSwitch;