-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[front/components/actions/retrieval] - feature: integrate icon mappin…
…g for document citations - Implement icon association based on document provider in citations - Utilize new `connectorIconMapper` to map providers to SVG icons in citations [front/components/markdown] - refactor: update MarkdownCitation to use icon components - Replace the static list of citation icon types with a dynamic icon component mapper - Include SVG component imports for icon representation in markdown citations [types] - refactor: expose ConnectorProviderDocumentType for usage across packages - Export type `ConnectorProviderDocumentType` to enable type usage in front-end components
- Loading branch information
1 parent
c4d765e
commit 0217d3c
Showing
3 changed files
with
36 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,39 @@ | ||
const CITATION_ICONS = [ | ||
"confluence", | ||
"document", | ||
"github", | ||
"google_drive", | ||
"intercom", | ||
"microsoft", | ||
"zendesk", | ||
"notion", | ||
"slack", | ||
"image", | ||
"snowflake", | ||
] as const; | ||
import { | ||
ConfluenceLogo, | ||
DocumentTextIcon, | ||
DriveLogo, | ||
GithubLogo, | ||
ImageIcon, | ||
IntercomLogo, | ||
MicrosoftLogo, | ||
NotionLogo, | ||
SlackLogo, | ||
SnowflakeLogo, | ||
ZendeskLogo, | ||
} from "@dust-tt/sparkle"; | ||
import type { ConnectorProviderDocumentType } from "@dust-tt/types"; | ||
import type { SVGProps } from "react"; | ||
|
||
export type CitationIconType = (typeof CITATION_ICONS)[number]; | ||
export const connectorIconMapper: Record< | ||
ConnectorProviderDocumentType | "image", | ||
(props: SVGProps<SVGSVGElement>) => React.JSX.Element | ||
> = { | ||
confluence: ConfluenceLogo, | ||
document: DocumentTextIcon, | ||
github: GithubLogo, | ||
google_drive: DriveLogo, | ||
intercom: IntercomLogo, | ||
microsoft: MicrosoftLogo, | ||
zendesk: ZendeskLogo, | ||
notion: NotionLogo, | ||
slack: SlackLogo, | ||
image: ImageIcon, | ||
snowflake: SnowflakeLogo, | ||
}; | ||
|
||
export interface MarkdownCitation { | ||
description?: string; | ||
href?: string; | ||
title: string; | ||
type: CitationIconType; | ||
icon: (props: SVGProps<SVGSVGElement>) => React.JSX.Element; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters