-
+
Select {type === 'chat' ? 'Chat Model' : 'Embedding Model'}
-
+
{type === 'chat'
? 'Select the model to use for chat responses'
: 'Select the model to use for embeddings'}
@@ -68,7 +75,7 @@ const ModelSelect = ({
})),
)
}
- className="w-full rounded-lg border border-light-200 dark:border-dark-200 bg-light-primary dark:bg-dark-primary px-4 py-3 text-sm text-black/80 dark:text-white/80 placeholder:text-black/40 dark:placeholder:text-white/40 focus-visible:outline-none focus-visible:border-light-300 dark:focus-visible:border-dark-300 transition-colors disabled:cursor-not-allowed disabled:opacity-60 cursor-pointer capitalize pr-12"
+ className="!text-xs lg:!text-sm"
loading={loading}
disabled={loading}
/>
diff --git a/src/components/Settings/SettingsDialogue.tsx b/src/components/Settings/SettingsDialogue.tsx
index f9291b1..7950954 100644
--- a/src/components/Settings/SettingsDialogue.tsx
+++ b/src/components/Settings/SettingsDialogue.tsx
@@ -1,5 +1,11 @@
import { Dialog, DialogPanel } from '@headlessui/react';
-import { BrainCog, ChevronLeft, Search, Settings } from 'lucide-react';
+import {
+ ArrowLeft,
+ BrainCog,
+ ChevronLeft,
+ Search,
+ Settings,
+} from 'lucide-react';
import General from './Sections/General';
import { motion } from 'framer-motion';
import { useEffect, useState } from 'react';
@@ -8,9 +14,11 @@ import Loader from '../ui/Loader';
import { cn } from '@/lib/utils';
import Models from './Sections/Models/Section';
import SearchSection from './Sections/Search';
+import Select from '@/components/ui/Select';
const sections = [
{
+ key: 'general',
name: 'General',
description: 'Adjust common settings.',
icon: Settings,
@@ -18,6 +26,7 @@ const sections = [
dataAdd: 'general',
},
{
+ key: 'models',
name: 'Models',
description: 'Configure model settings.',
icon: BrainCog,
@@ -25,6 +34,7 @@ const sections = [
dataAdd: 'modelProviders',
},
{
+ key: 'search',
name: 'Search',
description: 'Manage search settings.',
icon: Search,
@@ -42,7 +52,12 @@ const SettingsDialogue = ({
}) => {
const [isLoading, setIsLoading] = useState(true);
const [config, setConfig] = useState(null);
- const [activeSection, setActiveSection] = useState(sections[0]);
+ const [activeSection, setActiveSection] = useState(sections[0].key);
+ const [selectedSection, setSelectedSection] = useState(sections[0]);
+
+ useEffect(() => {
+ setSelectedSection(sections.find((s) => s.key === activeSection)!);
+ }, [activeSection]);
useEffect(() => {
if (isOpen) {
@@ -83,14 +98,14 @@ const SettingsDialogue = ({
transition={{ duration: 0.1 }}
className="fixed inset-0 flex w-screen items-center justify-center p-4 bg-black/30 backdrop-blur-sm h-screen"
>
-
+
{isLoading ? (
) : (
-
-
+
+
-
- {activeSection.component && (
-
-
+
+
+
+
+ {selectedSection.component && (
+
+
-
- {activeSection.name}
+
+ {selectedSection.name}
-
- {activeSection.description}
+
+ {selectedSection.description}
-
+
+
+
)}
diff --git a/src/components/Settings/SettingsField.tsx b/src/components/Settings/SettingsField.tsx
index 5245a4a..8b2fc41 100644
--- a/src/components/Settings/SettingsField.tsx
+++ b/src/components/Settings/SettingsField.tsx
@@ -59,11 +59,13 @@ const SettingsSelect = ({
};
return (
-
-
+
+
-
{field.name}
-
+
+ {field.name}
+
+
{field.description}
@@ -74,7 +76,7 @@ const SettingsSelect = ({
value: option.value,
label: option.name,
}))}
- className="w-full rounded-lg border border-light-200 dark:border-dark-200 bg-light-primary dark:bg-dark-primary px-4 py-3 text-sm text-black/80 dark:text-white/80 placeholder:text-black/40 dark:placeholder:text-white/40 focus-visible:outline-none focus-visible:border-light-300 dark:focus-visible:border-dark-300 transition-colors disabled:cursor-not-allowed disabled:opacity-60 cursor-pointer capitalize pr-12"
+ className="!text-xs lg:!text-sm"
loading={loading}
disabled={loading}
/>
@@ -128,11 +130,13 @@ const SettingsInput = ({
};
return (
-
-
+
+
-
{field.name}
-
+
+ {field.name}
+
+
{field.description}
@@ -141,7 +145,7 @@ const SettingsInput = ({
value={value ?? field.default ?? ''}
onChange={(event) => setValue(event.target.value)}
onBlur={(event) => handleSave(event.target.value)}
- className="w-full rounded-lg border border-light-200 dark:border-dark-200 bg-light-primary dark:bg-dark-primary px-4 py-3 pr-10 text-sm text-black/80 dark:text-white/80 placeholder:text-black/40 dark:placeholder:text-white/40 focus-visible:outline-none focus-visible:border-light-300 dark:focus-visible:border-dark-300 transition-colors disabled:cursor-not-allowed disabled:opacity-60"
+ className="w-full rounded-lg border border-light-200 dark:border-dark-200 bg-light-primary dark:bg-dark-primary px-3 py-2 lg:px-4 lg:py-3 pr-10 !text-xs lg:!text-sm text-black/80 dark:text-white/80 placeholder:text-black/40 dark:placeholder:text-white/40 focus-visible:outline-none focus-visible:border-light-300 dark:focus-visible:border-dark-300 transition-colors disabled:cursor-not-allowed disabled:opacity-60"
placeholder={field.placeholder}
type="text"
disabled={loading}
diff --git a/src/components/ui/Select.tsx b/src/components/ui/Select.tsx
index f8d7c30..2f42ab1 100644
--- a/src/components/ui/Select.tsx
+++ b/src/components/ui/Select.tsx
@@ -3,7 +3,7 @@ import { Loader2, ChevronDown } from 'lucide-react';
import { SelectHTMLAttributes, forwardRef } from 'react';
interface SelectProps extends SelectHTMLAttributes
{
- options: { value: string; label: string; disabled?: boolean }[];
+ options: { value: any; label: string; disabled?: boolean }[];
loading?: boolean;
}
@@ -21,7 +21,7 @@ export const Select = forwardRef(
ref={ref}
disabled={disabled || loading}
className={cn(
- 'bg-light-secondary dark:bg-dark-secondary px-3 py-2 flex items-center overflow-hidden border border-light-200 dark:border-dark-200 dark:text-white rounded-lg text-sm appearance-none w-full pr-10',
+ 'bg-light-secondary dark:bg-dark-secondary px-3 py-2 flex items-center overflow-hidden border border-light-200 dark:border-dark-200 dark:text-white rounded-lg appearance-none w-full pr-10 text-xs lg:text-sm',
className,
)}
>