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 (
{message.text === "Loading..." ? ( @@ -155,6 +190,11 @@ export const Message = ({ {ecommerceItems}
)} + {youtubeItems && youtubeItems.length > 0 && ( +
+ {youtubeItems} +
+ )} {message.text.length > 0 ? ( { return { diff --git a/clients/search-component/src/TrieveModal/index.css b/clients/search-component/src/TrieveModal/index.css index 3c184c1dce..51de50abac 100644 --- a/clients/search-component/src/TrieveModal/index.css +++ b/clients/search-component/src/TrieveModal/index.css @@ -352,7 +352,11 @@ body { box-sizing: border-box; a { - @apply rounded px-2 text-xs py-1 bg-zinc-200/50; + @apply rounded px-2 text-xs py-1 bg-zinc-200/50 flex flex-col gap-y-1 h-full; + + &.yt-anchor { + @apply text-center; + } &:hover { background-color: var(--tv-zinc-200); @@ -394,6 +398,10 @@ body { .ecommerce-featured-image-chat { @apply mb-1 max-h-48 aspect-auto mx-auto; } + + .yt-preview { + @apply h-16 w-28 block mx-auto; + } } .user { @@ -437,6 +445,10 @@ body { @apply list-decimal pl-4 my-4 overflow-hidden; } + li { + @apply my-2; + } + hr { @apply mb-4; } diff --git a/server/src/public/navbar.html b/server/src/public/navbar.html index 9d75c288f7..bef5cf06ac 100644 --- a/server/src/public/navbar.html +++ b/server/src/public/navbar.html @@ -17,7 +17,7 @@ params.forBrandName) else 'Prospect'|safe}}

-

+

- From

-
+