diff --git a/src/App.jsx b/src/App.jsx index 2915026..432cff9 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -3,10 +3,8 @@ import React, { useEffect, useLayoutEffect, useMemo, useRef, useState } from 're import { flushSync } from 'react-dom'; import TextareaAutosize from 'react-textarea-autosize'; import AssistantMessageContent from './AssistantMessageContent' -import GeneralSettings from './GeneralSettings' -import InterfaceSettings from './InterfaceSettings' import LibraryManager from './LibraryManager' -import WebsearchSettings from './WebsearchSettings' +import { SettingsPanel, SettingsSidebar } from './SettingsPanels' import { applyColorScheme } from './colorSchemes' import { AttachmentStrip, diff --git a/src/SettingsPanels.jsx b/src/SettingsPanels.jsx new file mode 100644 index 0000000..09c76de --- /dev/null +++ b/src/SettingsPanels.jsx @@ -0,0 +1,84 @@ +import GeneralSettings from './GeneralSettings' +import InterfaceSettings from './InterfaceSettings' +import WebsearchSettings from './WebsearchSettings' +import { normalizeWebsearchEngines } from './websearchEngines' + +const SETTINGS_SECTIONS = ['General', 'AI Models', 'Interface', 'Backend', 'Updates', 'Advanced'] + +export function SettingsSidebar({ activeSection, onSelect }) { + return ( +
+ {SETTINGS_SECTIONS.map(section => ( +
onSelect(section)} + > + {section} +
+ ))} +
+ ) +} + +export function SettingsPanel({ + activeSection, + onAudioInputDeviceChange, + onAudioInputLanguageChange, + onBackendApiUrlChange, + onLibrariesPurged, + onModelChange, + onStreamOutputChange, + onTranscriptionModelChange, + onVisionModelChange, + searxEngines, + searxUrl, + setSearxEngines, + setSearxUrl, + streamOutput, +}) { + return ( + <> +
+ {activeSection} Settings +
+ {activeSection === 'General' && ( + + )} + {activeSection === 'AI Models' && ( + + )} + {activeSection === 'Interface' && ( + + )} + {activeSection === 'Backend' && ( + setSearxEngines(normalizeWebsearchEngines(next))} + /> + )} + {activeSection === 'Updates' && ( + + )} + {activeSection === 'Advanced' && ( + + )} + + ) +}