import { useMemo } from 'react'; import { isElectronMode } from '@renderer/api'; import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from '@renderer/components/ui/tooltip'; import { Bell, Info, Settings, Wrench } from 'lucide-react'; import type { LucideIcon } from 'lucide-react'; export type SettingsSection = 'general' | 'connection' | 'notifications' | 'advanced'; interface SettingsTabsProps { activeSection: SettingsSection; onSectionChange: (section: SettingsSection) => void; } interface TabConfig { id: SettingsSection; label: string; icon: LucideIcon; description: string; electronOnly?: boolean; } const tabs: TabConfig[] = [ { id: 'general', label: 'General', icon: Settings, description: 'Core app preferences like theme, language, display density, and startup behavior.', }, // { id: 'connection', label: 'Connection', icon: Server, description: 'Manage CLI connection and authentication settings.', electronOnly: true }, { id: 'notifications', label: 'Notifications', icon: Bell, description: 'Control when and how you get notified about agent activity, task completions, and errors.', }, { id: 'advanced', label: 'Advanced', icon: Wrench, description: 'Power-user options: export/import config, reset defaults, and raw configuration editing.', }, ]; export const SettingsTabs = ({ activeSection, onSectionChange, }: Readonly): React.JSX.Element => { const isElectron = useMemo(() => isElectronMode(), []); const visibleTabs = useMemo( () => tabs.filter((tab) => !tab.electronOnly || isElectron), [isElectron] ); return (
{visibleTabs.map((tab) => { const Icon = tab.icon; const isActive = activeSection === tab.id; return ( ); })}
); };