"use client"; import { useTheme } from "next-themes"; import { Moon, Sun, Monitor } from "lucide-react"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; const OPTIONS = [ { value: "light", label: "Light", icon: Sun }, { value: "dark", label: "Dark", icon: Moon }, { value: "system", label: "System", icon: Monitor }, ] as const; export function ThemeToggle({ collapsed }: { collapsed?: boolean }) { const { theme, setTheme } = useTheme(); const current = OPTIONS.find((o) => o.value === theme) ?? OPTIONS[2]; const Icon = current.icon; return ( {!collapsed && Theme} } /> {OPTIONS.map((option) => ( setTheme(option.value)}> {option.label} ))} ); }