mirror of
https://github.com/QuivrHQ/quivr.git
synced 2024-12-16 18:52:12 +03:00
12 lines
302 B
TypeScript
12 lines
302 B
TypeScript
|
import { ChatItem, Notification } from "../types";
|
||
|
|
||
|
export const getNotificationsFromChatItems = (
|
||
|
chatItems: ChatItem[]
|
||
|
): Notification[] => {
|
||
|
const messages = chatItems
|
||
|
.filter((item) => item.item_type === "NOTIFICATION")
|
||
|
.map((item) => item.body as Notification);
|
||
|
|
||
|
return messages;
|
||
|
};
|