|
|
@@ -0,0 +1,64 @@
|
|
|
+<script lang="ts" module>
|
|
|
+ const ICONS: Record<string, typeof Bot> = {
|
|
|
+ language: BrainCircuit,
|
|
|
+ embedding: Layers,
|
|
|
+ reranker: ListOrdered,
|
|
|
+ cpu: Cpu,
|
|
|
+ file: FileText,
|
|
|
+ image: Image,
|
|
|
+ audio: AudioLines,
|
|
|
+ video: Video,
|
|
|
+ tool: Wrench,
|
|
|
+ toolbox: Toolbox,
|
|
|
+ book: BookOpen,
|
|
|
+ library: LibraryBig,
|
|
|
+ bot: Bot,
|
|
|
+ agent: BotMessageSquare,
|
|
|
+ sparkles: Sparkles,
|
|
|
+ messages: MessagesSquare,
|
|
|
+ };
|
|
|
+ export { ICONS };
|
|
|
+</script>
|
|
|
+
|
|
|
+<script lang="ts">
|
|
|
+ import {
|
|
|
+ AudioLines,
|
|
|
+ BookOpen,
|
|
|
+ Bot,
|
|
|
+ BotMessageSquare,
|
|
|
+ BrainCircuit,
|
|
|
+ Cpu,
|
|
|
+ FileText,
|
|
|
+ Image,
|
|
|
+ Layers,
|
|
|
+ LibraryBig,
|
|
|
+ ListOrdered,
|
|
|
+ MessagesSquare,
|
|
|
+ Sparkles,
|
|
|
+ Toolbox,
|
|
|
+ Video,
|
|
|
+ Wrench,
|
|
|
+ } from '@lucide/svelte';
|
|
|
+
|
|
|
+ let { icon, size = 48 }: { icon?: string | undefined; size?: number } = $props();
|
|
|
+
|
|
|
+ const Icon = $derived(icon === undefined ? Bot : ICONS[icon]);
|
|
|
+</script>
|
|
|
+
|
|
|
+{#if Icon}
|
|
|
+ <div
|
|
|
+ class={[
|
|
|
+ 'flex items-center justify-center',
|
|
|
+ size >= 16 ? 'rounded-md border border-primary bg-primary/25 p-2' : '',
|
|
|
+ ]}
|
|
|
+ >
|
|
|
+ <Icon class="text-primary" size={size >= 16 ? size - 12 : size} strokeWidth={2} />
|
|
|
+ </div>
|
|
|
+{:else}
|
|
|
+ <img
|
|
|
+ style={`height: ${size}px; width: ${size}px;`}
|
|
|
+ class="object-contain"
|
|
|
+ alt="icon"
|
|
|
+ src={icon}
|
|
|
+ />
|
|
|
+{/if}
|