diff --git a/web/app/components/base/alert.tsx b/web/app/components/base/alert.tsx index 53cb842567..43e0b1d42e 100644 --- a/web/app/components/base/alert.tsx +++ b/web/app/components/base/alert.tsx @@ -31,7 +31,7 @@ const Alert: React.FC = ({ className, }) => { return ( -
+
diff --git a/web/app/components/base/chat/chat/index.tsx b/web/app/components/base/chat/chat/index.tsx index 2e004c1145..df94d61d3d 100644 --- a/web/app/components/base/chat/chat/index.tsx +++ b/web/app/components/base/chat/chat/index.tsx @@ -36,6 +36,7 @@ import { useStore as useAppStore } from '@/app/components/app/store' import type { AppData } from '@/models/share' export type ChatProps = { + isTryApp?: boolean readonly?: boolean appData?: AppData chatList: ChatItem[] @@ -78,6 +79,7 @@ export type ChatProps = { } const Chat: FC = ({ + isTryApp, readonly = false, appData, config, @@ -241,7 +243,7 @@ const Chat: FC = ({
{chatNode}
{ return ( () const [conversationId, setConversationId] = useState() useEffect(() => { - if(isTryApp) return + if (isTryApp) return getProcessedSystemVariablesFromUrlParams().then(({ user_id, conversation_id }) => { setUserId(user_id) setConversationId(conversation_id) @@ -86,7 +86,7 @@ export const useEmbeddedChatbot = (appSourceType: AppSourceType, tryAppId?: stri }, []) useEffect(() => { - if(isTryApp) return + if (isTryApp) return const setLanguageFromParams = async () => { // Check URL parameters for language override const urlParams = new URLSearchParams(window.location.search) @@ -251,7 +251,7 @@ export const useEmbeddedChatbot = (appSourceType: AppSourceType, tryAppId?: stri useEffect(() => { // init inputs from url params (async () => { - if(isTryApp) + if (isTryApp) return const inputs = await getProcessedInputsFromUrlParams() const userVariables = await getProcessedUserVariablesFromUrlParams() diff --git a/web/app/components/explore/try-app/app/chat.tsx b/web/app/components/explore/try-app/app/chat.tsx index 2a12d9d8e4..9d5cead2dc 100644 --- a/web/app/components/explore/try-app/app/chat.tsx +++ b/web/app/components/explore/try-app/app/chat.tsx @@ -12,20 +12,31 @@ import { } from '@/app/components/base/chat/embedded-chatbot/hooks' import cn from '@/utils/classnames' import { AppSourceType } from '@/service/share' +import Alert from '@/app/components/base/alert' +import { useTranslation } from 'react-i18next' +import { useBoolean } from 'ahooks' +import type { TryAppInfo } from '@/service/try-app' +import AppIcon from '@/app/components/base/app-icon' type Props = { appId: string + appDetail: TryAppInfo className: string } const TryApp: FC = ({ appId, + appDetail, className, }) => { + const { t } = useTranslation() const media = useBreakpoints() const isMobile = media === MediaType.mobile const themeBuilder = useThemeContext() const chatData = useEmbeddedChatbot(AppSourceType.tryApp, appId) + const [isHideTryNotice, { + setTrue: hideTryNotice, + }] = useBoolean(false) return ( = ({ isMobile, themeBuilder, } as any}> -
- +
+
+
+ +
{appDetail.name}
+
+
+
+ {!isHideTryNotice && ( + + )} + +
) diff --git a/web/app/components/explore/try-app/app/index.tsx b/web/app/components/explore/try-app/app/index.tsx index 5569715c64..db8c5cd764 100644 --- a/web/app/components/explore/try-app/app/index.tsx +++ b/web/app/components/explore/try-app/app/index.tsx @@ -24,7 +24,7 @@ const TryApp: FC = ({ return (
{isChat && ( - + )} {isCompletion && (