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