FEAT: NEW WORKFLOW ENGINE (#3160)

Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: Yeuoly <admin@srmxy.cn>
Co-authored-by: JzoNg <jzongcode@gmail.com>
Co-authored-by: StyleZhang <jasonapring2015@outlook.com>
Co-authored-by: jyong <jyong@dify.ai>
Co-authored-by: nite-knite <nkCoding@gmail.com>
Co-authored-by: jyong <718720800@qq.com>
This commit is contained in:
takatost
2024-04-08 18:51:46 +08:00
committed by GitHub
parent 2fb9850af5
commit 7753ba2d37
1161 changed files with 103836 additions and 10327 deletions

View File

@@ -4,14 +4,15 @@ import { useClickAway } from 'ahooks'
import Card from './card'
import { CopyFeedbackNew } from '@/app/components/base/copy-feedback'
import { XClose } from '@/app/components/base/icons/src/vender/line/general'
import type { IChatItem } from '@/app/components/app/chat/type'
type PromptLogModalProps = {
log: { role: string; text: string }[]
currentLogItem?: IChatItem
width: number
onCancel: () => void
}
const PromptLogModal: FC<PromptLogModalProps> = ({
log,
currentLogItem,
width,
onCancel,
}) => {
@@ -27,7 +28,7 @@ const PromptLogModal: FC<PromptLogModalProps> = ({
setMounted(true)
}, [])
if (!log)
if (!currentLogItem || !currentLogItem.log)
return null
return (
@@ -40,9 +41,9 @@ const PromptLogModal: FC<PromptLogModalProps> = ({
<div className='text-base font-semibold text-gray-900'>PROMPT LOG</div>
<div className='flex items-center'>
{
log?.length === 1 && (
currentLogItem.log?.length === 1 && (
<>
<CopyFeedbackNew className='w-6 h-6' content={log[0].text} />
<CopyFeedbackNew className='w-6 h-6' content={currentLogItem.log[0].text} />
<div className='mx-2.5 w-[1px] h-[14px] bg-gray-200' />
</>
)
@@ -56,7 +57,7 @@ const PromptLogModal: FC<PromptLogModalProps> = ({
</div>
</div>
<div className='grow p-2 overflow-y-auto'>
<Card log={log} />
<Card log={currentLogItem.log} />
</div>
</div>
)