mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-20 13:05:49 +02:00
cleaner citations (#3389)
This commit is contained in:
@@ -30,57 +30,31 @@ export function Citation({
|
|||||||
? children?.toString().split("[")[1].split("]")[0]
|
? children?.toString().split("[")[1].split("]")[0]
|
||||||
: index;
|
: index;
|
||||||
|
|
||||||
if (link) {
|
const onClick = () => {
|
||||||
return (
|
if (document.source_type == ValidSources.File) {
|
||||||
<TooltipProvider delayDuration={0}>
|
updatePresentingDocument(document);
|
||||||
<Tooltip>
|
} else {
|
||||||
<TooltipTrigger asChild>
|
window.open(link || document.link, "_blank");
|
||||||
<div
|
}
|
||||||
onMouseDown={() => {
|
};
|
||||||
if (document.source_type == ValidSources.File) {
|
|
||||||
updatePresentingDocument(document);
|
return (
|
||||||
} else {
|
<TooltipProvider delayDuration={0}>
|
||||||
window.open(link, "_blank");
|
<Tooltip>
|
||||||
}
|
<TooltipTrigger asChild>
|
||||||
}}
|
<div
|
||||||
className="inline-flex items-center ml-1 cursor-pointer transition-all duration-200 ease-in-out"
|
onMouseDown={onClick}
|
||||||
>
|
className="inline-flex items-center cursor-pointer transition-all duration-200 ease-in-out"
|
||||||
<span className="relative min-w-[1.4rem] text-center no-underline -top-0.5 px-1.5 py-0.5 text-xs font-medium text-gray-700 bg-gray-100 rounded-full border border-gray-300 hover:bg-gray-200 hover:text-gray-900 shadow-sm no-underline">
|
>
|
||||||
{innerText}
|
<span className="flex items-center justify-center w-6 h-6 text-[11px] font-medium text-gray-700 bg-gray-100 rounded-full border border-gray-300 hover:bg-gray-200 hover:text-gray-900 shadow-sm">
|
||||||
</span>
|
{innerText}
|
||||||
</div>
|
</span>
|
||||||
</TooltipTrigger>
|
</div>
|
||||||
<TooltipContent width="mb-2 max-w-lg" className="bg-background">
|
</TooltipTrigger>
|
||||||
<CompactDocumentCard url={url} icon={icon} document={document} />
|
<TooltipContent width="mb-2 max-w-lg" className="bg-background">
|
||||||
</TooltipContent>
|
<CompactDocumentCard url={url} icon={icon} document={document} />
|
||||||
</Tooltip>
|
</TooltipContent>
|
||||||
</TooltipProvider>
|
</Tooltip>
|
||||||
);
|
</TooltipProvider>
|
||||||
} else {
|
);
|
||||||
return (
|
|
||||||
<TooltipProvider delayDuration={0}>
|
|
||||||
<Tooltip>
|
|
||||||
<TooltipTrigger asChild>
|
|
||||||
<div
|
|
||||||
onMouseDown={() => {
|
|
||||||
if (document.source_type == ValidSources.File) {
|
|
||||||
updatePresentingDocument(document);
|
|
||||||
} else {
|
|
||||||
window.open(document.link, "_blank");
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
className="inline-flex items-center ml-1 cursor-pointer transition-all duration-200 ease-in-out"
|
|
||||||
>
|
|
||||||
<span className="relative min-w-[1.4rem] pchatno-underline -top-0.5 px-1.5 py-0.5 text-xs font-medium text-gray-700 bg-gray-100 rounded-full border border-gray-300 hover:bg-gray-200 hover:text-gray-900 shadow-sm no-underline">
|
|
||||||
{innerText}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</TooltipTrigger>
|
|
||||||
<TooltipContent width="mb-2 max-w-lg" backgroundColor="bg-background">
|
|
||||||
<CompactDocumentCard url={url} icon={icon} document={document} />
|
|
||||||
</TooltipContent>
|
|
||||||
</Tooltip>
|
|
||||||
</TooltipProvider>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user