import { useState } from 'react';
import { useRecoilValue } from 'recoil';
import { Settings } from 'lucide-react';
import { DropdownMenuRadioItem } from '~/components';
import { getIcon } from '~/components/Endpoints';
import { SetTokenDialog } from '../SetTokenDialog';
import store from '~/store';
import { cn, alternateName } from '~/utils';
export default function ModelItem({
endpoint,
value,
isSelected,
}: {
endpoint: string;
value: string;
isSelected: boolean;
}) {
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}
>
);
}