diff --git a/clients/search-component/package.json b/clients/search-component/package.json index 1447abbefe..2b3cebb83d 100644 --- a/clients/search-component/package.json +++ b/clients/search-component/package.json @@ -19,7 +19,7 @@ "import": "./dist/vanilla/index.js" } }, - "version": "0.2.41", + "version": "0.2.43", "license": "MIT", "homepage": "https://github.com/devflowinc/trieve/tree/main/clients/search-component", "scripts": { diff --git a/clients/search-component/src/TrieveModal/Chat/ChatMessage.tsx b/clients/search-component/src/TrieveModal/Chat/ChatMessage.tsx index 6b62c7b3e6..238260a582 100644 --- a/clients/search-component/src/TrieveModal/Chat/ChatMessage.tsx +++ b/clients/search-component/src/TrieveModal/Chat/ChatMessage.tsx @@ -137,6 +137,41 @@ export const Message = ({ )); + const youtubeItems = message.additional + ?.filter( + (chunk) => + (chunk.metadata.heading || + chunk.metadata.title || + chunk.metadata.page_title) && + chunk.link && + chunk.metadata.yt_preview_src + ) + .map((chunk) => { + return { + title: + chunk.metadata.heading || + chunk.metadata.title || + chunk.metadata.page_title, + link: chunk.link, + metadata: chunk.metadata, + }; + }) + .map((item, index) => ( + + {item.metadata?.yt_preview_src ? ( + + ) : ( + <>> + )} + {item.title} + + )); + return (
+
- From