"use client"; import { useTheme } from "next-themes"; import { SunIcon, MoonIcon } from "lucide-react"; import { useEffect, useState } from "react"; export function ThemeToggle() { const { theme, setTheme } = useTheme(); const [mounted, setMounted] = useState(false); useEffect(() => setMounted(true), []); if (!mounted) { return
; } const isDark = theme === "dark"; return ( ); }