'use client' import type { Tool } from '@/app/components/tools/types' import * as React from 'react' import { useTranslation } from 'react-i18next' import Tooltip from '@/app/components/base/tooltip' import { useLocale } from '@/context/i18n' import { getLanguage } from '@/i18n-config/language' import { cn } from '@/utils/classnames' type Props = { tool: Tool } const MCPToolItem = ({ tool, }: Props) => { const locale = useLocale() const language = getLanguage(locale) const { t } = useTranslation() const renderParameters = () => { const parameters = tool.parameters if (parameters.length === 0) return null return (
{t('mcp.toolItem.parameters', { ns: 'tools' })} :
) } return (
{tool.label[language]}
{tool.description[language]}
{renderParameters()} )} >
{tool.label[language]}
{tool.description[language]}
) } export default MCPToolItem