diff --git a/web/app/components/explore/app-card/index.tsx b/web/app/components/explore/app-card/index.tsx index 923c5000a2..1f09575db3 100644 --- a/web/app/components/explore/app-card/index.tsx +++ b/web/app/components/explore/app-card/index.tsx @@ -80,7 +80,6 @@ const AppCard = ({ )} {isTrialApp && ( - // /try/app/${app.app_id} + {isLoading ? (
+ +
) : ( +
+
+ + +
+ {/* Main content */} +
+ {type === TypeEnum.TRY ? : } + +
- {/* Main content */} -
- {type === TypeEnum.TRY ? : } - -
- + )} ) } diff --git a/web/app/components/explore/try-app/preview/index.tsx b/web/app/components/explore/try-app/preview/index.tsx index d8a9640fe0..6c146f9a63 100644 --- a/web/app/components/explore/try-app/preview/index.tsx +++ b/web/app/components/explore/try-app/preview/index.tsx @@ -1,25 +1,20 @@ 'use client' import type { FC } from 'react' import React from 'react' -import { useGetTryAppInfo } from '@/service/use-try-app' import BasicAppPreview from './basic-app-preview' import FlowAppPreview from './flow-app-preview' -import Loading from '@/app/components/base/loading' +import type { TryAppInfo } from '@/service/try-app' type Props = { appId: string + appDetail: TryAppInfo } const Preview: FC = ({ appId, + appDetail, }) => { - const { data: appDetail, isLoading } = useGetTryAppInfo(appId) - const isBasicApp = appDetail ? ['agent-chat', 'chat', 'completion'].includes(appDetail.mode) : false - if (isLoading) { - return
- -
- } + const isBasicApp = ['agent-chat', 'chat', 'completion'].includes(appDetail.mode) return isBasicApp ? : } diff --git a/web/service/try-app.ts b/web/service/try-app.ts index 9e8b0cfe99..de00e0a6d7 100644 --- a/web/service/try-app.ts +++ b/web/service/try-app.ts @@ -11,7 +11,7 @@ import type { DataSetListResponse } from '@/models/datasets' import type { Edge, Node } from '@/app/components/workflow/types' import type { Viewport } from 'reactflow' -type TryAppInfo = { +export type TryAppInfo = { name: string mode: AppMode site: SiteInfo