"use client"; import * as React from "react"; import { Monitor, Moon, Sun } from "lucide-react"; import { useTheme } from "./ThemeProvider"; export function ThemeToggle() { const { theme, setTheme } = useTheme(); const [mounted, setMounted] = React.useState(false); React.useEffect(() => { setMounted(true); }, []); if (!mounted) { return
; } const cycle = () => { const next = theme === "system" ? "light" : theme === "light" ? "dark" : "system"; setTheme(next); }; return ( ); }