From ed21f9f90660cd50d0ce0b6fdf2f92853f4f563d Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 17 Jul 2024 11:53:49 +0200 Subject: [PATCH] refac: styling --- src/lib/components/chat/MessageInput.svelte | 2 +- src/lib/components/common/FileItem.svelte | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index a9bed21a2..228295b51 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -501,7 +501,7 @@ dir={$settings?.chatDirection ?? 'LTR'} > {#if files.length > 0} -
+
{#each files as file, fileIdx} {#if file.type === 'image'}
diff --git a/src/lib/components/common/FileItem.svelte b/src/lib/components/common/FileItem.svelte index 5a7b31e4b..b20c5a80b 100644 --- a/src/lib/components/common/FileItem.svelte +++ b/src/lib/components/common/FileItem.svelte @@ -7,8 +7,9 @@ export let className = 'w-72'; export let url: string | null = null; - export let dismissible = false; + export let clickHandler: Function | null = null; + export let dismissible = false; export let status = 'processed'; export let name: string; @@ -20,12 +21,16 @@ class="h-14 {className} flex items-center space-x-3 bg-white dark:bg-gray-800 rounded-xl border border-gray-100 dark:border-gray-800 text-left" type="button" on:click={async () => { - if (url) { - if (type === 'file') { - window.open(`${url}/content`, '_blank').focus(); - } else { - window.open(`${url}`, '_blank').focus(); + if (clickHandler === null) { + if (url) { + if (type === 'file') { + window.open(`${url}/content`, '_blank').focus(); + } else { + window.open(`${url}`, '_blank').focus(); + } } + } else { + clickHandler(); } }} >