feat: add optional free model tag display
This commit is contained in:
parent
a70e69caf9
commit
a051f9fa44
@ -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>
|
||||||
|
|||||||
@ -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>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user