From 6e9f82491dd749e9ca5674ad8cff7e12c9e5401e Mon Sep 17 00:00:00 2001 From: Joel Date: Thu, 23 Oct 2025 15:51:59 +0800 Subject: [PATCH] chore: reuse the app detail and right meta --- web/app/components/explore/app-card/index.tsx | 1 - .../explore/try-app/app-info/index.tsx | 38 ++++++++++++++- .../components/explore/try-app/app/index.tsx | 20 +++----- web/app/components/explore/try-app/index.tsx | 48 +++++++++++-------- .../explore/try-app/preview/index.tsx | 13 ++--- web/service/try-app.ts | 2 +- 6 files changed, 75 insertions(+), 47 deletions(-) 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