feat: editing of messages

This commit is contained in:
Alexander Daichendt 2025-02-12 13:28:28 +01:00
parent 4d87f86ff7
commit f27adc3360
7 changed files with 115 additions and 11 deletions

View file

@ -18,6 +18,7 @@ export type ChatState = {
};
export type ChatAction =
| { type: "EDIT_MESSAGE"; payload: { messageId: string; newContent: string } }
| { type: "ADD_MESSAGE"; payload: Message }
| { type: "DELETE_MESSAGE"; payload: string }
| { type: "SET_USER"; payload: User }
@ -25,6 +26,7 @@ export type ChatAction =
| { type: "CLEAR_MESSAGES" };
export type ChatActions = {
editMessage: (messageId: string, newContent: string) => void;
addMessage: (message: Message) => void;
deleteMessage: (messageId: string) => void;
setUser: (user: User) => void;