-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
176 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...ts/header/account-setting/model-provider-page/model-selector/deprecated-model-trigger.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import type { FC } from 'react' | ||
import { useTranslation } from 'react-i18next' | ||
import ModelIcon from '../model-icon' | ||
import { AlertTriangle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback' | ||
import { useProviderContext } from '@/context/provider-context' | ||
import TooltipPlus from '@/app/components/base/tooltip-plus' | ||
|
||
type ModelTriggerProps = { | ||
modelName: string | ||
providerName: string | ||
className?: string | ||
} | ||
const ModelTrigger: FC<ModelTriggerProps> = ({ | ||
modelName, | ||
providerName, | ||
className, | ||
}) => { | ||
const { t } = useTranslation() | ||
const { modelProviders } = useProviderContext() | ||
const currentProvider = modelProviders.find(provider => provider.provider === providerName) | ||
|
||
return ( | ||
<div | ||
className={` | ||
group flex items-center px-2 h-8 rounded-lg bg-[#FFFAEB] cursor-pointer | ||
${className} | ||
`} | ||
> | ||
<ModelIcon | ||
className='shrink-0 mr-1.5' | ||
provider={currentProvider} | ||
modelName={modelName} | ||
/> | ||
<div className='mr-1 text-[13px] font-medium text-gray-800 truncate'> | ||
{modelName} | ||
</div> | ||
<div className='shrink-0 flex items-center justify-center w-4 h-4'> | ||
<TooltipPlus popupContent={t('common.modelProvider.deprecated')}> | ||
<AlertTriangle className='w-4 h-4 text-[#F79009]' /> | ||
</TooltipPlus> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ModelTrigger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.