'use client'; import {useTheme} from 'next-themes'; import {useEffect, useState} from 'react'; import { SunIcon, MoonIcon } from '@heroicons/react/24/outline'; export default function ThemeToggle() { const {theme, setTheme} = useTheme(); const [mounted, setMounted] = useState(false); // Fix hydration mismatch useEffect(() => setMounted(true), []); if (!mounted) return null; const isDark = theme === 'dark'; return ( ); }