]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/blob
636e93f221111a1fab2b2f2e5c490248c1cb50d4
[pkg/ggml/sources/llama.cpp] /
1 <script lang="ts">
2 import { ChatMessageMcpPromptContent, ActionIcon } from '$lib/components/app';
3 import { X } from '@lucide/svelte';
4 import type { DatabaseMessageExtraMcpPrompt } from '$lib/types';
5 import { McpPromptVariant } from '$lib/enums';
6
7 interface Props {
8 class?: string;
9 isLoading?: boolean;
10 loadError?: string;
11 onRemove?: () => void;
12 prompt: DatabaseMessageExtraMcpPrompt;
13 readonly?: boolean;
14 }
15
16 let {
17 class: className = '',
18 isLoading = false,
19 loadError,
20 onRemove,
21 prompt,
22 readonly = false
23 }: Props = $props();
24 </script>
25
26 <div class="group relative {className}">
27 <ChatMessageMcpPromptContent
28 {isLoading}
29 {loadError}
30 {prompt}
31 variant={McpPromptVariant.ATTACHMENT}
32 />
33
34 {#if !readonly && onRemove}
35 <div
36 class="absolute top-10 right-2 flex items-center justify-center opacity-0 transition-opacity group-hover:opacity-100"
37 >
38 <ActionIcon icon={X} tooltip="Remove" stopPropagationOnClick onclick={() => onRemove?.()} />
39 </div>
40 {/if}
41 </div>