diff --git a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx index 940d69cd..964b2971 100644 --- a/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx +++ b/frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx @@ -39,21 +39,31 @@ const CIRCLE_IMAGES = { outlookAttachment: OutlookLogo, }; +/** + * Returns the custom image for a given type, or null if no custom image is available. + * @param {string} type + * @returns {string|null} + */ +export function getCustomImage(type) { + return CIRCLE_IMAGES[type] ?? null; +} + /** * Renders a circle with a source type icon inside, or a favicon if URL is provided. * @param {"file"|"link"|"youtube"|"github"|"gitlab"|"confluence"|"drupalwiki"|"obsidian"|"paperlessNgx"} props.type * @param {number} [props.size] - Circle diameter in px * @param {number} [props.iconSize] - Icon size in px * @param {string} [props.url] - Optional URL to fetch favicon from + * @param {string} [props.customImage] - Optional custom image to display */ export function SourceTypeCircle({ type = "file", size = 22, iconSize = 12, url = null, + customImage = null, }) { const Icon = CIRCLE_ICONS[type] || CIRCLE_ICONS.file; - const customImage = CIRCLE_IMAGES[type]; const [imgError, setImgError] = useState(false); let faviconUrl = null; @@ -72,7 +82,7 @@ export function SourceTypeCircle({ return (
{source.title}