import React, { useState } from "react"; import { useTheme } from "next-themes"; import { HiSun, HiMoon } from "react-icons/hi"; export const ThemeSwitch = () => { const { theme, setTheme } = useTheme(); const [enabled, setEnabled] = useState(true); const handleCheck = () => { setEnabled(!enabled); } // Use theme requires its own hook which uses Strings. Using an enabled, disabled for a bool hook and the following block translates that to a string. if (enabled) { setTheme("dark"); } else { setTheme("light"); } return (
{/*
Dark Mode
*/}
); };