mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-26 17:51:54 +01:00
Make it so docs without links aren't clickable in chat citations
This commit is contained in:
parent
10dcd49fc8
commit
402d83e167
@ -139,24 +139,31 @@ export const AIMessage = ({
|
||||
{citedDocuments
|
||||
.filter(([_, document]) => document.semantic_identifier)
|
||||
.map(([citationKey, document], ind) => {
|
||||
return (
|
||||
<a
|
||||
key={document.document_id}
|
||||
href={document.link}
|
||||
target="_blank"
|
||||
className="text-sm border border-border py-1 px-2 rounded flex cursor-pointer hover:bg-hover"
|
||||
>
|
||||
<div className="max-w-350 text-ellipsis flex">
|
||||
<div className="mr-1 my-auto">
|
||||
<SourceIcon
|
||||
sourceType={document.source_type}
|
||||
iconSize={16}
|
||||
/>
|
||||
</div>
|
||||
[{citationKey}] {document!.semantic_identifier}
|
||||
const display = (
|
||||
<div className="max-w-350 text-ellipsis flex text-sm border border-border py-1 px-2 rounded flex">
|
||||
<div className="mr-1 my-auto">
|
||||
<SourceIcon
|
||||
sourceType={document.source_type}
|
||||
iconSize={16}
|
||||
/>
|
||||
</div>
|
||||
</a>
|
||||
[{citationKey}] {document!.semantic_identifier}
|
||||
</div>
|
||||
);
|
||||
if (document.link) {
|
||||
return (
|
||||
<a
|
||||
key={document.document_id}
|
||||
href={document.link}
|
||||
target="_blank"
|
||||
className="cursor-pointer hover:bg-hover"
|
||||
>
|
||||
{display}
|
||||
</a>
|
||||
);
|
||||
} else {
|
||||
return <div className="cursor-default">{display}</div>;
|
||||
}
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user