import { useState } from 'react';
import { DropdownMenuRadioItem } from '../../ui/DropdownMenu.tsx';
import { Settings } from 'lucide-react';
import getIcon from '~/utils/getIcon';
import { useRecoilValue } from 'recoil';
import SetTokenDialog from '../SetTokenDialog';
import store from '../../../store';
import { cn } from '~/utils/index.jsx';
const alternateName = {
openAI: 'OpenAI',
azureOpenAI: 'Azure OpenAI',
bingAI: 'Bing',
chatGPTBrowser: 'ChatGPT',
gptPlugins: 'Plugins',
google: 'PaLM'
};
export default function ModelItem({ endpoint, value, isSelected }) {
const [setTokenDialogOpen, setSetTokenDialogOpen] = useState(false);
const endpointsConfig = useRecoilValue(store.endpointsConfig);
const icon = getIcon({
size: 20,
endpoint,
error: false,
className: 'mr-2',
message: false
});
const isUserProvided = endpointsConfig?.[endpoint]?.userProvide;
// regular model
return (
<>
{icon}
{alternateName[endpoint] || endpoint}
{endpoint === 'gptPlugins' && (
Beta
)}
{isUserProvided ? (
) : null}
>
);
}