mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-28 08:51:00 +02:00
fix internet search icons / text + assistants tab (#1862)
This commit is contained in:
parent
5230f7e22f
commit
2dc7e64dd7
@ -143,6 +143,7 @@ export default function SidebarWrapper<T extends object>({
|
||||
<div className="mt-4 mx-auto">{content(contentProps)}</div>
|
||||
</div>
|
||||
</div>
|
||||
<FixedLogo />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -67,9 +67,6 @@ export default async function GalleryPage({
|
||||
user={user}
|
||||
assistants={assistants}
|
||||
/>
|
||||
|
||||
{/* Temporary - fixed logo */}
|
||||
<FixedLogo />
|
||||
</ChatProvider>
|
||||
</>
|
||||
);
|
||||
|
@ -57,6 +57,8 @@ import {
|
||||
import { ValidSources } from "@/lib/types";
|
||||
import { Tooltip } from "@/components/tooltip/Tooltip";
|
||||
import { useMouseTracking } from "./hooks";
|
||||
import { InternetSearchIcon } from "@/components/InternetSearchIcon";
|
||||
import { getTitleFromDocument } from "@/lib/sources";
|
||||
|
||||
const TOOLS_WITH_CUSTOM_HANDLING = [
|
||||
SEARCH_TOOL_NAME,
|
||||
@ -443,17 +445,17 @@ export const AIMessage = ({
|
||||
>
|
||||
<Citation link={doc.link} index={ind + 1} />
|
||||
<p className="shrink truncate ellipsis break-all ">
|
||||
{
|
||||
doc.document_id.split("/")[
|
||||
doc.document_id.split("/").length - 1
|
||||
]
|
||||
}
|
||||
{getTitleFromDocument(doc)}
|
||||
</p>
|
||||
<div className="ml-auto flex-none">
|
||||
{doc.is_internet ? (
|
||||
<InternetSearchIcon url={doc.link} />
|
||||
) : (
|
||||
<SourceIcon
|
||||
sourceType={doc.source_type}
|
||||
iconSize={18}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</a>
|
||||
<div className="flex overscroll-x-scroll mt-.5">
|
||||
|
@ -38,7 +38,11 @@ import {
|
||||
ColorSlackIcon,
|
||||
} from "@/components/icons/icons";
|
||||
import { ValidSources } from "./types";
|
||||
import { SourceCategory, SourceMetadata } from "./search/interfaces";
|
||||
import {
|
||||
DanswerDocument,
|
||||
SourceCategory,
|
||||
SourceMetadata,
|
||||
} from "./search/interfaces";
|
||||
import { Persona } from "@/app/admin/assistants/interfaces";
|
||||
import { FaAccessibleIcon, FaSlack } from "react-icons/fa";
|
||||
|
||||
@ -290,3 +294,16 @@ export function getSourcesForPersona(persona: Persona): ValidSources[] {
|
||||
});
|
||||
return personaSources;
|
||||
}
|
||||
|
||||
function stripTrailingSlash(str: string) {
|
||||
if (str.substr(-1) === "/") {
|
||||
return str.substr(0, str.length - 1);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
export const getTitleFromDocument = (document: DanswerDocument) => {
|
||||
return stripTrailingSlash(document.document_id).split("/")[
|
||||
stripTrailingSlash(document.document_id).split("/").length - 1
|
||||
];
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user