diff --git a/web/app/components/base/alert.tsx b/web/app/components/base/alert.tsx index 1ea329e380..53cb842567 100644 --- a/web/app/components/base/alert.tsx +++ b/web/app/components/base/alert.tsx @@ -31,9 +31,9 @@ const Alert: React.FC = ({ className, }) => { return ( -
+
diff --git a/web/app/components/explore/try-app/app/text-generation.tsx b/web/app/components/explore/try-app/app/text-generation.tsx index a0e8ffa660..1cb778ba52 100644 --- a/web/app/components/explore/try-app/app/text-generation.tsx +++ b/web/app/components/explore/try-app/app/text-generation.tsx @@ -21,6 +21,7 @@ import Res from '@/app/components/share/text-generation/result' import { AppSourceType } from '@/service/share' import { TaskStatus } from '@/app/components/share/text-generation/types' import Alert from '@/app/components/base/alert' +import { useTranslation } from 'react-i18next' type Props = { appId: string @@ -35,6 +36,7 @@ const TextGeneration: FC = ({ isWorkflow, appData, }) => { + const { t } = useTranslation() const media = useBreakpoints() const isPC = media === MediaType.pc @@ -115,7 +117,13 @@ const TextGeneration: FC = ({ })() }, [appData, appParams]) - const handleCompleted = noop + const [isCompleted, setIsCompleted] = useState(false) + const handleCompleted = useCallback(() => { + setIsCompleted(true) + }, []) + const [isHideTryNotice, { + setTrue: hideTryNotice, + }] = useBoolean(false) const renderRes = (task?: Task) => ( = ({
- + {isCompleted && !isHideTryNotice && ( + + )} {renderRes()}
@@ -167,7 +177,7 @@ const TextGeneration: FC = ({ return (
= ({ {/* Left */}
{/* Header */} -
+
= ({
{/* form */}
diff --git a/web/i18n/en-US/explore.ts b/web/i18n/en-US/explore.ts index 649b744b89..b1891f6d3e 100644 --- a/web/i18n/en-US/explore.ts +++ b/web/i18n/en-US/explore.ts @@ -38,6 +38,7 @@ const translation = { createFromSampleApp: 'Create from this sample app', category: 'Category', requirements: 'Requirements', + tryInfo: 'This is a sample app. You can try up to 5 messages. To keep using it, click "Create form this sample app" and set it up!', }, appCustomize: { title: 'Create app from {{name}}', diff --git a/web/i18n/ja-JP/explore.ts b/web/i18n/ja-JP/explore.ts index d3f5bc421c..2639bfc1dd 100644 --- a/web/i18n/ja-JP/explore.ts +++ b/web/i18n/ja-JP/explore.ts @@ -39,6 +39,7 @@ const translation = { createFromSampleApp: 'テンプレートから作成', category: 'カテゴリー', requirements: '必要項目', + tryInfo: 'これはサンプルアプリです。最大5件のメッセージまでお試しいただけます。引き続き利用するには、「テンプレートから作成」 をクリックして設定を行ってください。', }, appCustomize: { title: '{{name}}からアプリを作成', diff --git a/web/i18n/zh-Hans/explore.ts b/web/i18n/zh-Hans/explore.ts index e8152e2067..2080033904 100644 --- a/web/i18n/zh-Hans/explore.ts +++ b/web/i18n/zh-Hans/explore.ts @@ -39,6 +39,7 @@ const translation = { createFromSampleApp: '从此模板创建应用', category: '分类', requirements: '必须配置项', + tryInfo: '这是一个示例应用,您可以试用最多 5 条消息。如需继续使用,请点击 “从此模板创建应用” 并完成配置!', }, appCustomize: { title: '从 {{name}} 创建应用程序',