"use client"; import { Moon, Sun } from "lucide-react"; import { useTheme } from "next-themes"; import { useEffect, useState } from "react"; import { Button } from "@/src/components/ui/button"; export function ThemeToggle() { const { setTheme, theme, resolvedTheme } = useTheme(); const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); }, []); if (!mounted) { return ( ); } const activeTheme = theme === "system" ? resolvedTheme : theme; const isDark = activeTheme === "dark"; return ( ); }