useChatMessageMenuItemActions
The useChatMessageMenuItemActions
hook is designed to handle moderation menu item actions in a chat application. It provides functions that are executed when a user clicks on moderation menu items associated with chat messages.
Example usage
const { deleteMessageApiFn, reportMessageApiFn, blockUserApiFn } = useChatMessageMenuItemActions({
messageDetails: {}
});
Hook Argument
messageDetails
messageDetails
Type | Default |
---|---|
UseChatMessageMenuItemActionsArg (Required) | No Default |
Hook Return Value
deleteMessageApiFn
deleteMessageApiFn
A function executed when the user clicks the Delete
menu item. This can be used to delete the user's own message.
Type |
---|
Function of type: () => void |
reportMessageApiFn
reportMessageApiFn
A function executed when the user clicks the Report
menu item. This can be used to report someone else's message.
Type |
---|
Function of type: () => void |
blockUserApiFn
blockUserApiFn
A function executed when the user clicks the Block
menu item. This can be used to block the user associated with the message.
Type |
---|
Function of type: () => void |
Updated 12 months ago