'use client'; import { Settings as SettingsIcon, ArrowLeft, Loader2, Info, Trash2, Edit3, PlusCircle, Save, X, RotateCcw, ChevronDown, ChevronRight, Eye, EyeOff, } from 'lucide-react'; import { useEffect, useState, useRef } from 'react'; import { cn } from '@/lib/utils'; import { Switch } from '@headlessui/react'; import ThemeSwitcher from '@/components/theme/Switcher'; import { ImagesIcon, VideoIcon, Layers3 } from 'lucide-react'; import Link from 'next/link'; import { PROVIDER_METADATA } from '@/lib/providers'; import Optimization from '@/components/MessageInputActions/Optimization'; import ModelSelector from '@/components/MessageInputActions/ModelSelector'; interface SettingsType { chatModelProviders: { [key: string]: [Record]; }; embeddingModelProviders: { [key: string]: [Record]; }; openaiApiKey: string; groqApiKey: string; openrouterApiKey: string; anthropicApiKey: string; geminiApiKey: string; ollamaApiUrl: string; lmStudioApiUrl: string; deepseekApiKey: string; aimlApiKey: string; customOpenaiApiKey: string; customOpenaiApiUrl: string; customOpenaiModelName: string; ollamaContextWindow: number; hiddenModels: string[]; } interface InputProps extends React.InputHTMLAttributes { isSaving?: boolean; onSave?: (value: string) => void; } const InputComponent = ({ className, isSaving, onSave, ...restProps }: InputProps) => { return (
onSave?.(e.target.value)} /> {isSaving && (
)}
); }; interface TextareaProps extends React.InputHTMLAttributes { isSaving?: boolean; onSave?: (value: string) => void; } const TextareaComponent = ({ className, isSaving, onSave, ...restProps }: TextareaProps) => { return (