diff --git a/src/components/Settings/Sections/ChatSettings.tsx b/src/components/Settings/Sections/ChatSettings.tsx index 52b0e044..0efd4de8 100644 --- a/src/components/Settings/Sections/ChatSettings.tsx +++ b/src/components/Settings/Sections/ChatSettings.tsx @@ -4,9 +4,14 @@ import FieldWrapper from '../Elements/FieldWrapper' import { useSettings } from '../../../hooks/useSettings' import { validateApiKey } from '../../../lib/validApiKey' import { AvailableModels, Mode } from '../../../config/settings' +import { capitalizeText } from '../../../lib/capitalizeText' +import { useState } from 'react' +import { AiOutlineEye, AiOutlineEyeInvisible } from 'react-icons/ai' const ChatSettings = () => { const [settings, setSettings] = useSettings() + const [showPassword, setShowPassword] = useState(false) + const chatSettings = settings.chat const apiKeyInputRef = React.useRef(null) @@ -81,14 +86,29 @@ const ChatSettings = () => { onSubmit={handleOpenAiKeySubmit} >
- +
+ + + +
@@ -109,9 +129,15 @@ const ChatSettings = () => { className="input cdx-w-44" onChange={handleModalChange} > - {Object.values(AvailableModels).map((modal) => ( + {Object.keys(AvailableModels).map((modal) => ( ))} @@ -131,11 +157,13 @@ const ChatSettings = () => { onChange={handleModeChange} className="input cdx-w-36" > - {Object.entries(Mode).map(([mode, value]) => ( - - ))} + {Object.keys(Mode) + .filter((v) => Number.isNaN(Number(v))) + .map((value) => ( + + ))}
diff --git a/src/components/Settings/Sections/GeneralSettings.tsx b/src/components/Settings/Sections/GeneralSettings.tsx index 4e276909..683b786b 100644 --- a/src/components/Settings/Sections/GeneralSettings.tsx +++ b/src/components/Settings/Sections/GeneralSettings.tsx @@ -4,6 +4,7 @@ import FieldWrapper from '../Elements/FieldWrapper' import { useSettings } from '../../../hooks/useSettings' import { ThemeOptions } from '../../../config/settings' import * as Switch from '@radix-ui/react-switch' +import { capitalizeText } from '../../../lib/capitalizeText' const GeneralSettings = () => { const [settings, setSettings] = useSettings() @@ -36,7 +37,7 @@ const GeneralSettings = () => { > {Object.values(ThemeOptions).map((theme) => ( ))} diff --git a/src/lib/capitalizeText.ts b/src/lib/capitalizeText.ts new file mode 100644 index 00000000..b390f41f --- /dev/null +++ b/src/lib/capitalizeText.ts @@ -0,0 +1,6 @@ +export const capitalizeText = (text: string): string => { + return text + .split(' ') + .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .join(' ') +}