import { ChevronDown, Sliders, Star, Zap } from 'lucide-react'; import { cn } from '@/lib/utils'; import { Popover, PopoverButton, PopoverPanel, Transition, } from '@headlessui/react'; import { Fragment } from 'react'; const OptimizationModes = [ { key: 'speed', title: 'Speed', description: 'Prioritize speed and get the quickest possible answer.', icon: , }, { key: 'balanced', title: 'Balanced', description: 'Find the right balance between speed and accuracy', icon: , }, { key: 'quality', title: 'Quality (Soon)', description: 'Get the most thorough and accurate answer', icon: ( ), }, ]; const Optimization = ({ optimizationMode, setOptimizationMode, }: { optimizationMode: string; setOptimizationMode: (mode: string) => void; }) => { return ( { OptimizationModes.find((mode) => mode.key === optimizationMode) ?.icon } { OptimizationModes.find((mode) => mode.key === optimizationMode) ?.title } {OptimizationModes.map((mode, i) => ( setOptimizationMode(mode.key)} key={i} disabled={mode.key === 'quality'} className={cn( 'p-2 rounded-lg flex flex-col items-start justify-start text-start space-y-1 duration-200 cursor-pointer transition', optimizationMode === mode.key ? 'bg-light-secondary dark:bg-dark-secondary' : 'hover:bg-light-secondary dark:hover:bg-dark-secondary', mode.key === 'quality' && 'opacity-50 cursor-not-allowed', )} > {mode.icon} {mode.title} {mode.description} ))} ); }; export default Optimization;
{ OptimizationModes.find((mode) => mode.key === optimizationMode) ?.title }
{mode.title}
{mode.description}