Skip to content

Commit

Permalink
⚡ fix: update actionCall back fu
Browse files Browse the repository at this point in the history
  • Loading branch information
ONLY-yours committed Jun 11, 2024
1 parent 5ff3b89 commit 9b4a0b1
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/ActionIconGroup/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const ActionIconGroup = memo<ActionIconGroupProps>(
const tooltipsPlacement = placement || (direction === 'column' ? 'right' : 'top');

const mergeDropDownList = dropdownMenu?.map((item: any) => {
console.log('##cloes', item);
return {
...item,
icon: <Icon icon={item.icon} size="small" />,
Expand Down
39 changes: 39 additions & 0 deletions src/ProChat/demos/actionsCallBack.tsx
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>
);
};

0 comments on commit 9b4a0b1

Please sign in to comment.