1
+ import { CopyOutlined } from '@ant-design/icons'
1
2
import { XStream } from '@ant-design/x'
2
3
import {
3
4
DifyApi ,
@@ -10,7 +11,7 @@ import {
10
11
} from '@dify-chat/api'
11
12
import { AppModeEnums , useAppContext } from '@dify-chat/core'
12
13
import { copyToClipboard } from '@toolkit-fe/clipboard'
13
- import { Button , Empty , Form , message , Tabs } from 'antd'
14
+ import { Button , Empty , Form , message , Tabs , Tooltip } from 'antd'
14
15
import { useState } from 'react'
15
16
16
17
import {
@@ -302,13 +303,24 @@ export default function WorkflowLayout(props: IWorkflowLayoutProps) {
302
303
303
304
{ /* 文本生成结果渲染 */ }
304
305
{ appMode === AppModeEnums . TEXT_GENERATOR && (
305
- < div className = "md:flex-1 px-4 pt-6 overflow-x-hidden overflow-y-auto bg-theme-bg" >
306
+ < div className = "md:flex-1 px-4 pt-6 relative overflow-x-hidden overflow-y-auto bg-theme-bg" >
306
307
{ textGenerateStatus === 'init' ? (
307
308
< div className = "w-full h-full flex items-center justify-center" >
308
309
< Empty description = { `点击 "运行" 试试看, AI 会给你带来意想不到的惊喜。 ` } />
309
310
</ div >
310
311
) : (
311
- < MarkdownRenderer markdownText = { text } />
312
+ < >
313
+ < MarkdownRenderer markdownText = { text } />
314
+ < Tooltip title = "复制内容" >
315
+ < CopyOutlined
316
+ className = "absolute top-6 right-6 cursor-pointer"
317
+ onClick = { async ( ) => {
318
+ await copyToClipboard ( text )
319
+ message . success ( '已复制到剪贴板' )
320
+ } }
321
+ />
322
+ </ Tooltip >
323
+ </ >
312
324
) }
313
325
</ div >
314
326
) }
0 commit comments