import React, { useState } from "react"; import { useTheme } from "next-themes"; import { Switch } from "@headlessui/react"; export const ThemeSwitch = () => { const { theme, setTheme } = useTheme(); const [enabled, setEnabled] = useState(true); // Use theme requires its own hook which uses Strings. Using an enabled, disabled for a bool hook and following translates that to a string. if (enabled) { setTheme("dark"); } else { setTheme("light"); } return (