import { useEffect, useState } from "react" import classNames from "clsx" import { useTheme } from "next-themes" export const SwitchTheme: React.FC = () => { const [mounted, setMounted] = useState(false) const { theme, setTheme } = useTheme() useEffect(() => { setMounted(true) }, []) if (!mounted) { return null } const handleClick = (): void => { setTheme(theme === "dark" ? "light" : "dark") } return (