feat: add optional free model tag display

This commit is contained in:
kangfenmao 2025-01-07 11:23:32 +08:00
parent a70e69caf9
commit a051f9fa44
2 changed files with 4 additions and 3 deletions

View File

@ -10,15 +10,16 @@ import WebSearchIcon from './Icons/WebSearchIcon'
interface ModelTagsProps {
model: Model
showFree?: boolean
}
const ModelTags: FC<ModelTagsProps> = ({ model }) => {
const ModelTags: FC<ModelTagsProps> = ({ model, showFree = true }) => {
const { t } = useTranslation()
return (
<>
{isVisionModel(model) && <VisionIcon />}
{isWebSearchModel(model) && <WebSearchIcon />}
{isFreeModel(model) && (
{showFree && isFreeModel(model) && (
<Tag style={{ marginLeft: 10 }} color="green">
{t('models.free')}
</Tag>

View File

@ -39,7 +39,7 @@ const SelectModelButton: FC<Props> = ({ assistant }) => {
<ModelName>
{model ? model.name : t('button.select_model')} {providerName ? '| ' + providerName : ''}
</ModelName>
<ModelTags model={model} />
<ModelTags model={model} showFree={false} />
</ButtonContent>
</DropdownButton>
)