From 8e6b0aa0bc044446224fc9075ba62f1d1ae76873 Mon Sep 17 00:00:00 2001 From: Chukwuma Nwaugha Date: Fri, 6 Dec 2024 14:51:38 +0000 Subject: [PATCH] improve chat_box attachment and attachment preview components --- .../lib/components/ChatBoxAttachment.svelte | 5 ++--- .../ChatBoxAttachmentPreview.svelte | 22 +++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/app/src/lib/components/ChatBoxAttachment.svelte b/app/src/lib/components/ChatBoxAttachment.svelte index 4679683..1c9a9f7 100644 --- a/app/src/lib/components/ChatBoxAttachment.svelte +++ b/app/src/lib/components/ChatBoxAttachment.svelte @@ -23,8 +23,7 @@ const files = Array.from(fileList); if (selectedFiles.length + files.length > MAX_FILES) { - alert(`You can only upload up to ${MAX_FILES} files`); - return; + return toast.info(`You can only upload up to ${MAX_FILES} files`); } selectedFiles = [...selectedFiles, ...files]; @@ -47,7 +46,7 @@ -
+
{#each selectedFiles as file, index} -
+

{file.name}

- {formatFileSize(file.size)} • {file.type || 'text/plain'} + {formatFileSize(file.size)} • {parseFileType(file)}