import { useState } from 'react'; import { useRecoilValue } from 'recoil'; import { Settings } from 'lucide-react'; import { DropdownMenuRadioItem } from '~/components'; import { Icon } from '~/components/Endpoints'; import { SetKeyDialog } from '../SetKeyDialog'; import { useLocalize } from '~/hooks'; import store from '~/store'; import { cn, alternateName } from '~/utils'; export default function ModelItem({ endpoint, value, isSelected, }: { endpoint: string; value: string; isSelected: boolean; }) { const [isDialogOpen, setDialogOpen] = useState(false); const endpointsConfig = useRecoilValue(store.endpointsConfig); const icon = Icon({ size: 20, endpoint, error: false, className: 'mr-2', message: false, isCreatedByUser: false, }); const userProvidesKey = endpointsConfig?.[endpoint]?.userProvide; const localize = useLocalize(); // regular model return ( <> {icon} {alternateName[endpoint] || endpoint} {endpoint === 'gptPlugins' && ( Beta )}
{userProvidesKey ? ( ) : null} {userProvidesKey && ( )} ); }