import { useEffect, useState } from "react"; import { Monitor, Moon, Sun } from "lucide-react"; import { useTheme } from "next-themes"; export const ThemeSwitcherButtons = () => { const { theme, setTheme } = useTheme(); const [selectedTheme, setSelectedTheme] = useState("dark"); // Sync local state with theme context useEffect(() => { if (theme) { setSelectedTheme(theme); } }, [theme]); const handleThemeChange = (newTheme: string) => { setSelectedTheme(newTheme); setTheme(newTheme); }; return (