import type { FC } from 'react' import { useTranslation } from 'react-i18next' import { RiArrowDownSLine } from '@remixicon/react' import type { Model, ModelItem, ModelProvider, } from '../declarations' import { MODEL_STATUS_TEXT } from '../declarations' import { useLanguage } from '../hooks' import ModelIcon from '../model-icon' import ModelName from '../model-name' import cn from '@/utils/classnames' import { useProviderContext } from '@/context/provider-context' import { SlidersH } from '@/app/components/base/icons/src/vender/line/mediaAndDevices' import { AlertTriangle } from '@/app/components/base/icons/src/vender/line/alertsAndFeedback' import Tooltip from '@/app/components/base/tooltip' export type TriggerProps = { open?: boolean disabled?: boolean currentProvider?: ModelProvider | Model currentModel?: ModelItem providerName?: string modelId?: string hasDeprecated?: boolean modelDisabled?: boolean isInWorkflow?: boolean } const Trigger: FC = ({ disabled, currentProvider, currentModel, providerName, modelId, hasDeprecated, modelDisabled, isInWorkflow, }) => { const { t } = useTranslation() const language = useLanguage() const { modelProviders } = useProviderContext() return (
{ currentProvider && ( ) } { !currentProvider && ( item.provider === providerName)} modelName={modelId} /> ) } { currentModel && ( ) } { !currentModel && (
{modelId}
) } { disabled ? ( ) : ( ) } {isInWorkflow && ()}
) } export default Trigger