mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-24 11:52:45 +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;
|
||
|
};
|