generated from arvinxx/npm-template
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ff3b89
commit 9b4a0b1
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* compact: true | ||
*/ | ||
import { chats } from '@/ProChat/mocks/threebody'; | ||
import { ProChat } from '@ant-design/pro-chat'; | ||
import { message } from 'antd'; | ||
import { useTheme } from 'antd-style'; | ||
|
||
export default () => { | ||
const theme = useTheme(); | ||
|
||
return ( | ||
<div style={{ background: theme.colorBgLayout }}> | ||
<ProChat | ||
showTitle | ||
userMeta={{ | ||
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg', | ||
title: 'Ant Design', | ||
}} | ||
chatItemRenderConfig={{ | ||
actionsCallbacks: { | ||
onEditFinished: (value, chatId) => { | ||
message.info(`编辑完成,内容为:${value},消息ID为:${chatId}`); | ||
}, | ||
onRegenerateFinished: (id, error) => { | ||
if (error) { | ||
message.error(`消息ID为:${id}的消息重新生成失败`); | ||
} else { | ||
message.success(`消息ID为:${id}的消息重新生成成功`); | ||
} | ||
}, | ||
}, | ||
}} | ||
assistantMeta={{ avatar: '🛸', title: '三体世界', backgroundColor: '#67dedd' }} | ||
initialChats={Object.values(chats.chats)} | ||
/> | ||
</div> | ||
); | ||
}; |