"use client"; import { useTheme } from "@/components/theme/theme-provider"; import { Moon, Sun, Monitor, Sunset, Waves, Check } from "lucide-react"; import { Button } from "@/components/ui/button"; import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; // The four looks, shown as two "modes" with a shared System row. Each entry // is one next-themes value (see app/layout.tsx for the class mapping); the // little dot is the theme's own accent so the picker previews the vibe. const OPTIONS = [ { value: "default", label: "Default", icon: Sun, swatch: "#4f56e0" }, { value: "sunset", label: "Sunset", icon: Sunset, swatch: "#c2410c" }, { value: "dark", label: "Dark", icon: Moon, swatch: "#7c83f2" }, { value: "ocean", label: "Ocean", icon: Waves, swatch: "#5eead4" }, ] as const; const CURRENT_ICONS = { default: Sun, sunset: Sunset, dark: Moon, ocean: Waves, system: Monitor, } as const; export function ThemeToggle({ collapsed }: { collapsed?: boolean }) { const { theme, setTheme } = useTheme(); // The picker always shows the four real themes; "system" is handled by a // dedicated row since it resolves to one of them per device preference. const known = OPTIONS.find((o) => o.value === theme); const isSystem = theme === "system" || theme === undefined; const Icon = (isSystem ? CURRENT_ICONS.system : known?.icon) ?? CURRENT_ICONS.system; const label = isSystem ? "System" : known?.label ?? "Default"; return ( {!collapsed && Theme} } /> Appearance {OPTIONS.map((option) => ( ))} ); }