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 { interface ModelTagsProps {
model: Model model: Model
showFree?: boolean
} }
const ModelTags: FC<ModelTagsProps> = ({ model }) => { const ModelTags: FC<ModelTagsProps> = ({ model, showFree = true }) => {
const { t } = useTranslation() const { t } = useTranslation()
return ( return (
<> <>
{isVisionModel(model) && <VisionIcon />} {isVisionModel(model) && <VisionIcon />}
{isWebSearchModel(model) && <WebSearchIcon />} {isWebSearchModel(model) && <WebSearchIcon />}
{isFreeModel(model) && ( {showFree && isFreeModel(model) && (
<Tag style={{ marginLeft: 10 }} color="green"> <Tag style={{ marginLeft: 10 }} color="green">
{t('models.free')} {t('models.free')}
</Tag> </Tag>

View File

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