'use client' import React from 'react' import { useTranslation } from 'react-i18next' import { RiArrowDownSLine, RiEqualizer2Line, } from '@remixicon/react' import BlockIcon from '@/app/components/workflow/block-icon' import { BlockEnum } from '@/app/components/workflow/types' import type { ToolWithProvider } from '@/app/components/workflow/types' import cn from '@/utils/classnames' type Props = { open: boolean provider?: ToolWithProvider value?: { provider_name: string tool_name: string } isConfigure?: boolean } const ToolTrigger = ({ open, provider, value, isConfigure, }: Props) => { const { t } = useTranslation() return (
{value?.provider_name && provider && (
)} {value?.tool_name && (
{value.tool_name}
)} {!value?.provider_name && (
{!isConfigure ? t('plugin.detailPanel.toolSelector.placeholder') : t('plugin.detailPanel.configureTool')}
)} {isConfigure && ( )} {!isConfigure && ( )}
) } export default ToolTrigger