import React from 'react'; import CheckMark from '../svg/CheckMark'; import { Listbox, Transition } from '@headlessui/react'; import { useRecoilValue } from 'recoil'; import { cn } from '~/utils/'; import store from '~/store'; function ModelDropDown({ model, setModel, endpoint, showAbove = false, showLabel = true, containerClassName, className }) { const endpointsConfig = useRecoilValue(store.endpointsConfig); const models = endpointsConfig?.[endpoint]?.['availableModels'] || []; return (
{({ open }) => ( <> {' '} {showLabel && ( Model )} {!showLabel && Model:} {model} {models.map((modelOption, i) => ( {modelOption} {modelOption === model && ( )} ))} )} {/* Model {model} {models.map((modelOption, i) => ( {modelOption} {modelOption === model && ( )} ))} */}
); } export default ModelDropDown;