mirror of
https://github.com/langgenius/dify.git
synced 2026-01-08 07:14:14 +00:00
24 lines
618 B
TypeScript
24 lines
618 B
TypeScript
'use client'
|
|
import type { FC } from 'react'
|
|
import React from 'react'
|
|
import BasicAppPreview from './basic-app-preview'
|
|
import FlowAppPreview from './flow-app-preview'
|
|
import type { TryAppInfo } from '@/service/try-app'
|
|
|
|
type Props = {
|
|
appId: string
|
|
appDetail: TryAppInfo
|
|
}
|
|
|
|
const Preview: FC<Props> = ({
|
|
appId,
|
|
appDetail,
|
|
}) => {
|
|
const isBasicApp = ['agent-chat', 'chat', 'completion'].includes(appDetail.mode)
|
|
|
|
return <div className='h-full w-full'>
|
|
{isBasicApp ? <BasicAppPreview appId={appId} /> : <FlowAppPreview appId={appId} className='h-full' />}
|
|
</div>
|
|
}
|
|
export default React.memo(Preview)
|