Skip to content

Commit 9b4a0b1

Browse files
committed
⚡ fix: update actionCall back fu
1 parent 5ff3b89 commit 9b4a0b1

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

src/ActionIconGroup/index.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ const ActionIconGroup = memo<ActionIconGroupProps>(
6969
const tooltipsPlacement = placement || (direction === 'column' ? 'right' : 'top');
7070

7171
const mergeDropDownList = dropdownMenu?.map((item: any) => {
72-
console.log('##cloes', item);
7372
return {
7473
...item,
7574
icon: <Icon icon={item.icon} size="small" />,

src/ProChat/demos/actionsCallBack.tsx

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* compact: true
3+
*/
4+
import { chats } from '@/ProChat/mocks/threebody';
5+
import { ProChat } from '@ant-design/pro-chat';
6+
import { message } from 'antd';
7+
import { useTheme } from 'antd-style';
8+
9+
export default () => {
10+
const theme = useTheme();
11+
12+
return (
13+
<div style={{ background: theme.colorBgLayout }}>
14+
<ProChat
15+
showTitle
16+
userMeta={{
17+
avatar: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
18+
title: 'Ant Design',
19+
}}
20+
chatItemRenderConfig={{
21+
actionsCallbacks: {
22+
onEditFinished: (value, chatId) => {
23+
message.info(`编辑完成,内容为:${value},消息ID为:${chatId}`);
24+
},
25+
onRegenerateFinished: (id, error) => {
26+
if (error) {
27+
message.error(`消息ID为:${id}的消息重新生成失败`);
28+
} else {
29+
message.success(`消息ID为:${id}的消息重新生成成功`);
30+
}
31+
},
32+
},
33+
}}
34+
assistantMeta={{ avatar: '🛸', title: '三体世界', backgroundColor: '#67dedd' }}
35+
initialChats={Object.values(chats.chats)}
36+
/>
37+
</div>
38+
);
39+
};

0 commit comments

Comments
 (0)