import { CodeIcon, Laptop, Moon, Settings, Sun } from "lucide-react" import { Button } from "@/components/ui/button" import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu" import { useTheme } from "next-themes" import { useMemo } from "react" import { KeymapType } from "@/lib/types" import { cn } from "@/lib/utils" import { useKeymapType } from "@/hooks/useKeymapType" import { NEXT_PUBLIC_SOURCEBOT_VERSION } from "@/lib/environment.client"; interface SettingsDropdownProps { menuButtonClassName?: string; } export const SettingsDropdown = ({ menuButtonClassName, }: SettingsDropdownProps) => { const { theme: _theme, setTheme } = useTheme(); const [ keymapType, setKeymapType ] = useKeymapType(); const theme = useMemo(() => { return _theme ?? "light"; }, [_theme]); const ThemeIcon = useMemo(() => { switch (theme) { case "light": return ; case "dark": return ; case "system": return ; default: return ; } }, [theme]); return ( Settings {ThemeIcon} Theme Light Dark System Code navigation setKeymapType(value as KeymapType)}> Default Vim
version: {NEXT_PUBLIC_SOURCEBOT_VERSION}
) }