diff --git a/surfsense_web/components/tool-ui/citation/citation-list.tsx b/surfsense_web/components/tool-ui/citation/citation-list.tsx index bbe869a09..26066b66f 100644 --- a/surfsense_web/components/tool-ui/citation/citation-list.tsx +++ b/surfsense_web/components/tool-ui/citation/citation-list.tsx @@ -1,22 +1,13 @@ "use client"; -import type { LucideIcon } from "lucide-react"; -import { Code2, Database, ExternalLink, File, FileText, Globe, Newspaper } from "lucide-react"; +import { ExternalLink, Globe } from "lucide-react"; import NextImage from "next/image"; import * as React from "react"; import { openSafeNavigationHref, resolveSafeNavigationHref } from "../shared/media"; import { cn, Popover, PopoverContent, PopoverTrigger } from "./_adapter"; import { Citation } from "./citation"; -import type { CitationType, CitationVariant, SerializableCitation } from "./schema"; - -const TYPE_ICONS: Record = { - webpage: Globe, - document: FileText, - article: Newspaper, - api: Database, - code: Code2, - other: File, -}; +import type { CitationVariant, SerializableCitation } from "./schema"; +import { TYPE_ICONS } from "./type-icons"; function useHoverPopover(delay = 100) { const [open, setOpen] = React.useState(false); diff --git a/surfsense_web/components/tool-ui/citation/citation.tsx b/surfsense_web/components/tool-ui/citation/citation.tsx index c60034a0a..05ce214f3 100644 --- a/surfsense_web/components/tool-ui/citation/citation.tsx +++ b/surfsense_web/components/tool-ui/citation/citation.tsx @@ -1,24 +1,15 @@ "use client"; -import type { LucideIcon } from "lucide-react"; -import { Code2, Database, ExternalLink, File, FileText, Globe, Newspaper } from "lucide-react"; +import { ExternalLink, Globe } from "lucide-react"; import NextImage from "next/image"; import * as React from "react"; import { openSafeNavigationHref, sanitizeHref } from "../shared/media"; import { cn, Popover, PopoverContent, PopoverTrigger } from "./_adapter"; -import type { CitationType, CitationVariant, SerializableCitation } from "./schema"; +import type { CitationVariant, SerializableCitation } from "./schema"; +import { TYPE_ICONS } from "./type-icons"; const FALLBACK_LOCALE = "en-US"; -const TYPE_ICONS: Record = { - webpage: Globe, - document: FileText, - article: Newspaper, - api: Database, - code: Code2, - other: File, -}; - function extractDomain(url: string): string | undefined { try { const urlObj = new URL(url); diff --git a/surfsense_web/components/tool-ui/citation/type-icons.ts b/surfsense_web/components/tool-ui/citation/type-icons.ts new file mode 100644 index 000000000..81bcf8a00 --- /dev/null +++ b/surfsense_web/components/tool-ui/citation/type-icons.ts @@ -0,0 +1,12 @@ +import type { LucideIcon } from "lucide-react"; +import { Code2, Database, File, FileText, Globe, Newspaper } from "lucide-react"; +import type { CitationType } from "./schema"; + +export const TYPE_ICONS: Record = { + webpage: Globe, + document: FileText, + article: Newspaper, + api: Database, + code: Code2, + other: File, +};