|
1 | 1 | import { ReactNode } from 'react';
|
2 | 2 |
|
| 3 | +import { ActionEvent } from '@/ActionIconGroup'; |
3 | 4 | import { ActionsProps } from '@/ChatList/ActionsBar';
|
4 | 5 | import { EditableMessageProps } from '@/EditableMessage';
|
5 | 6 | import { ChatMessageError, DivProps, MetaData } from '@/types';
|
6 | 7 | import { MarkdownProps } from '@ant-design/pro-editor';
|
7 | 8 |
|
8 | 9 | export type WithFalse<T> = T | false;
|
9 | 10 |
|
| 11 | +export type actionsClickProps = { |
| 12 | + onStartEdit: () => void; |
| 13 | + onFinishEdit: () => void; |
| 14 | + onClick: (actionKey: ActionEvent) => void; |
| 15 | +}; |
10 | 16 | export interface ChatItemProps<T = Record<string, any>> {
|
11 | 17 | /**
|
12 | 18 | * @description Actions to be displayed in the chat item
|
13 | 19 | */
|
14 | 20 | actions?: ReactNode;
|
| 21 | + /** |
| 22 | + * @description Actions click props,only use in render |
| 23 | + */ |
| 24 | + actionsClick?: actionsClickProps; |
15 | 25 | /**
|
16 | 26 | * @description Metadata for the avatar
|
17 | 27 | */
|
@@ -88,7 +98,9 @@ export interface ChatItemProps<T = Record<string, any>> {
|
88 | 98 | chatItemRenderConfig?: {
|
89 | 99 | titleRender?: WithFalse<(props: ChatItemProps, defaultDom: ReactNode) => ReactNode>;
|
90 | 100 | contentRender?: WithFalse<(props: ChatItemProps, defaultDom: ReactNode) => ReactNode>;
|
91 |
| - actionsRender?: WithFalse<(props: ChatItemProps, defaultDom: ReactNode) => ReactNode>; |
| 101 | + actionsRender?: WithFalse< |
| 102 | + (props: ChatItemProps, defaultDom: ReactNode, actionsClick: actionsClickProps) => ReactNode |
| 103 | + >; |
92 | 104 | avatarRender?: WithFalse<(props: ChatItemProps, defaultDom: ReactNode) => ReactNode>;
|
93 | 105 | render?: WithFalse<
|
94 | 106 | (
|
|
0 commit comments