diff --git a/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx b/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx index dccb0962e80..6069bd6f425 100644 --- a/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx +++ b/web/src/app/chat/documentSidebar/ChatDocumentDisplay.tsx @@ -7,7 +7,7 @@ import { DocumentUpdatedAtBadge } from "@/components/search/DocumentUpdatedAtBad import { MetadataBadge } from "@/components/MetadataBadge"; import { WebResultIcon } from "@/components/WebResultIcon"; import { Dispatch, SetStateAction } from "react"; -import { ValidSources } from "@/lib/types"; +import { openDocument } from "@/lib/search/utils"; interface DocumentDisplayProps { closeSidebar: () => void; @@ -73,14 +73,6 @@ export function ChatDocumentDisplay({ return null; } - const handleViewFile = async () => { - if (document.source_type == ValidSources.File && setPresentingDocument) { - setPresentingDocument(document); - } else if (document.link) { - window.open(document.link, "_blank"); - } - }; - const hasMetadata = document.updated_at || Object.keys(document.metadata).length > 0; return ( @@ -91,7 +83,7 @@ export function ChatDocumentDisplay({ }`} >