import React from 'react'; import { AzureMinimalIcon, OpenAIMinimalIcon, ChatGPTMinimalIcon, PluginMinimalIcon, BingAIMinimalIcon, PaLMinimalIcon, AnthropicMinimalIcon, } from '~/components/svg'; import { cn } from '~/utils'; import { IconProps } from '~/common'; const MinimalIcon: React.FC = (props) => { const { size = 30, error } = props; let endpoint = 'default'; // Default value for endpoint if (typeof props.endpoint === 'string') { endpoint = props.endpoint; } const endpointIcons = { azureOpenAI: { icon: , name: props.chatGptLabel || 'ChatGPT' }, openAI: { icon: , name: props.chatGptLabel || 'ChatGPT' }, gptPlugins: { icon: , name: 'Plugins' }, google: { icon: , name: props.modelLabel || 'PaLM2' }, anthropic: { icon: , name: props.modelLabel || 'Claude' }, bingAI: { icon: , name: 'BingAI' }, chatGPTBrowser: { icon: , name: 'ChatGPT' }, default: { icon: , name: 'UNKNOWN' }, }; const { icon, name } = endpointIcons[endpoint]; return (
{icon} {error && ( ! )}
); }; export default MinimalIcon;