import Tooltip from '@/app/components/base/tooltip' import Link from 'next/link' import { SwitchPluginVersion } from '@/app/components/workflow/nodes/_base/components/switch-plugin-version' import { useInstalledPluginList } from '@/service/use-plugins' import { RiErrorWarningFill } from '@remixicon/react' type StatusIndicatorsProps = { needsConfiguration: boolean modelProvider: boolean inModelList: boolean disabled: boolean pluginInfo: any t: any } const StatusIndicators = ({ needsConfiguration, modelProvider, inModelList, disabled, pluginInfo, t }: StatusIndicatorsProps) => { const { data: pluginList } = useInstalledPluginList() const renderTooltipContent = (title: string, description?: string, linkText?: string, linkHref?: string) => { return (
e.stopPropagation()}>
{title}
{description && (
{description}
)} {linkText && linkHref && (
{ e.stopPropagation() }} > {linkText}
)}
) } // const installedPluginUniqueIdentifier = pluginList?.plugins.find(plugin => plugin.name === pluginInfo.name)?.plugin_unique_identifier return ( <> {/* plugin installed and model is in model list but disabled */} {/* plugin installed from github/local and model is not in model list */} {!needsConfiguration && modelProvider && disabled && ( <> {inModelList ? ( ) : !pluginInfo ? ( ) : ( plugin.name === pluginInfo.name)?.plugin_unique_identifier ?? ''} /> )} )} {!modelProvider && !pluginInfo && ( )} ) } export default StatusIndicators