From de3911e930e859b7e3fdf6f0c1ab181999c826dd Mon Sep 17 00:00:00 2001
From: crazywoola <100913391+crazywoola@users.noreply.github.com>
Date: Thu, 19 Dec 2024 21:19:08 +0800
Subject: [PATCH] Fix/10584 wrong message when no custom tool available in
custom tool list (#11851)
---
web/app/components/tools/add-tool-modal/empty.tsx | 12 +++++++++---
web/i18n/en-US/tools.ts | 2 ++
web/i18n/zh-Hans/tools.ts | 2 ++
3 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/web/app/components/tools/add-tool-modal/empty.tsx b/web/app/components/tools/add-tool-modal/empty.tsx
index 051ae446d4..794d2a585c 100644
--- a/web/app/components/tools/add-tool-modal/empty.tsx
+++ b/web/app/components/tools/add-tool-modal/empty.tsx
@@ -1,13 +1,19 @@
+'use client'
+import { useSearchParams } from 'next/navigation'
import { useTranslation } from 'react-i18next'
-
const Empty = () => {
const { t } = useTranslation()
+ const searchParams = useSearchParams()
return (
-
{t('tools.addToolModal.emptyTitle')}
-
{t('tools.addToolModal.emptyTip')}
+
+ {t(`tools.addToolModal.${searchParams.get('category') === 'workflow' ? 'emptyTitle' : 'emptyTitleCustom'}`)}
+
+
+ {t(`tools.addToolModal.${searchParams.get('category') === 'workflow' ? 'emptyTip' : 'emptyTipCustom'}`)}
+
)
}
diff --git a/web/i18n/en-US/tools.ts b/web/i18n/en-US/tools.ts
index f96ae8144e..b1f278f9ce 100644
--- a/web/i18n/en-US/tools.ts
+++ b/web/i18n/en-US/tools.ts
@@ -31,6 +31,8 @@ const translation = {
manageInTools: 'Manage in Tools',
emptyTitle: 'No workflow tool available',
emptyTip: 'Go to "Workflow -> Publish as Tool"',
+ emptyTitleCustom: 'No custom tool available',
+ emptyTipCustom: 'Create a custom tool',
},
createTool: {
title: 'Create Custom Tool',
diff --git a/web/i18n/zh-Hans/tools.ts b/web/i18n/zh-Hans/tools.ts
index 1473fc23d3..a788ef0abe 100644
--- a/web/i18n/zh-Hans/tools.ts
+++ b/web/i18n/zh-Hans/tools.ts
@@ -31,6 +31,8 @@ const translation = {
manageInTools: '去工具列表管理',
emptyTitle: '没有可用的工作流工具',
emptyTip: '去 “工作流 -> 发布为工具” 添加',
+ emptyTitleCustom: '没有可用的自定义工具',
+ emptyTipCustom: '创建自定义工具',
},
createTool: {
title: '创建自定义工具',