fix: update model icon

This commit is contained in:
Yi
2025-01-07 16:31:15 +08:00
parent 130cfaf2a4
commit 2f5da1f6aa
3 changed files with 9 additions and 11 deletions

View File

@@ -28,11 +28,11 @@ const ModelIcon: FC<ModelIconProps> = ({
if (provider?.icon_small) {
return (
<div className={`flex items-center justify-center ${isDeprecated ? 'opacity-50' : ''}`}>
<div className={`flex items-center justify-center w-5 h-5 ${isDeprecated ? 'opacity-50' : ''}`}>
<img
alt='model-icon'
src={`${provider.icon_small[language] || provider.icon_small.en_US}`}
className={cn('w-5 h-5', className)}
className={cn('w-4.5 h-4.5', className)}
/>
</div>
)

View File

@@ -107,7 +107,7 @@ const AgentModelTrigger: FC<AgentModelTriggerProps> = ({
{modelId ? (
<>
<ModelIcon
className="m-0.5"
className='p-0.5'
provider={currentProvider || modelProvider}
modelName={currentModel?.model || modelId}
isDeprecated={hasDeprecated}

View File

@@ -34,20 +34,18 @@ const ModelTrigger: FC<ModelTriggerProps> = ({
return (
<div
className={cn(
'group flex items-center p-1 gap-0.5 rounded-lg bg-components-input-bg-normal',
'group flex items-center p-1 h-6 gap-0.5 rounded-lg bg-components-input-bg-normal',
!readonly && 'hover:bg-components-input-bg-hover cursor-pointer',
open && 'bg-components-input-bg-hover',
model.status !== ModelStatusEnum.active && 'bg-components-input-bg-disabled hover:bg-components-input-bg-disabled',
className,
)}
>
<div className='flex items-center justify-center w-6 h-6'>
<ModelIcon
className='w-5 h-5 m-0.5'
provider={provider}
modelName={model.model}
/>
</div>
<ModelIcon
className='p-0.5'
provider={provider}
modelName={model.model}
/>
<div className='flex px-1 py-[3px] items-center gap-1 grow truncate'>
<ModelName
className='grow'