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"
interface SettingsDropdownProps {
keymapType: KeymapType;
onKeymapTypeChange: (keymapType: KeymapType) => void;
}
export const SettingsDropdown = ({
keymapType,
onKeymapTypeChange,
}: SettingsDropdownProps) => {
const { theme: _theme, setTheme } = useTheme();
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
onKeymapTypeChange(value as KeymapType)}>
Default
Vim
)
}