/** * Settings Dropdown Component * Consolidates various settings and preferences into a single dropdown menu */ import React from 'react'; import { Button } from '@/components/ui/button'; import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, } from '@/components/ui/dropdown-menu'; import { Settings, Palette, Keyboard, Info, HelpCircle, Download, Upload } from 'lucide-react'; import { themes } from '@/config/themes'; import { updateTheme } from '@/utils/theme-fix'; interface SettingsDropdownProps { onShowKeyboardShortcuts?: () => void; onShowTutorial?: () => void; onShowExportDialog?: () => void; onShowImportDialog?: () => void; hasSelectedMemories?: boolean; selectedCount?: number; className?: string; } export function SettingsDropdown({ onShowKeyboardShortcuts, onShowTutorial, onShowExportDialog, onShowImportDialog, hasSelectedMemories = false, selectedCount = 0, className = '' }: SettingsDropdownProps) { const [currentTheme, setCurrentTheme] = React.useState( localStorage.getItem('like-i-said-theme') || 'dark' ); const handleThemeChange = (themeId: string) => { setCurrentTheme(themeId); updateTheme(themeId); }; return ( Settings {/* Theme Selector Submenu */} Theme {Object.entries(themes).map(([id, theme]) => ( handleThemeChange(id)} className="cursor-pointer" >
{theme.name} {currentTheme === id && ( )}
))}
{/* Keyboard Shortcuts */} {onShowKeyboardShortcuts && ( Keyboard Shortcuts ? )} {/* Data Management */} {onShowExportDialog && ( Export Memories {hasSelectedMemories && ( {selectedCount} )} )} {onShowImportDialog && ( Import Memories )} {/* Help & Info */} {onShowTutorial && ( Tutorial )} window.open('https://github.com/endlessblink/Like-I-Said-memory-mcp-server', '_blank')}> About
); }