import React, { useEffect, useState } from 'react' 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 ( <>
🌜
🌞
) }