$['firstEmpty.learnDifyTitle'], { ns: 'app' })}
/>
diff --git a/web/app/components/apps/index.tsx b/web/app/components/apps/index.tsx
index 4aed098a7ae..07376c80d18 100644
--- a/web/app/components/apps/index.tsx
+++ b/web/app/components/apps/index.tsx
@@ -1,5 +1,6 @@
'use client'
import type { CreateAppModalProps } from '../explore/create-app-modal'
+import type { App } from '@/models/explore'
import type { TryAppSelection } from '@/types/try-app'
import type { TrackCreateAppParams } from '@/utils/create-app-tracking'
import { useAtomValue } from 'jotai'
@@ -60,6 +61,16 @@ const Apps = () => {
}
const [isShowCreateModal, setIsShowCreateModal] = useState(false)
+ const handleTryLearnDify = (params: TryAppSelection) => {
+ setShowTryAppPanel(true, params)
+ }
+ const handleCreateLearnDify = (app: App) => {
+ if (!canCreateApp) return
+
+ setCurrentTryAppParams({ appId: app.app_id, app })
+ setIsShowCreateModal(true)
+ }
+
const handleShowFromTryApp = useCallback(() => {
if (!canCreateApp) return
@@ -190,7 +201,11 @@ const Apps = () => {
}}
>
-
+
{isShowTryAppPanel && (
type Props = Readonly<{
controlRefreshList?: number
+ onCreateLearnDify?: (app: App) => void
+ onTryLearnDify?: (params: TryAppSelection) => void
}>
-function List({ controlRefreshList = 0 }: Props) {
+function List({ controlRefreshList = 0, onCreateLearnDify, onTryLearnDify }: Props) {
const { t } = useTranslation()
const { data: systemFeatures } = useSuspenseQuery(systemFeaturesQueryOptions())
const workspacePermissionKeys = useAtomValue(workspacePermissionKeysAtom)
@@ -270,8 +274,10 @@ function List({ controlRefreshList = 0 }: Props) {
{showFirstEmptyState ? (
) : (