From 71985c325b7a414cf353fb4c5b39980bc06a3cbb Mon Sep 17 00:00:00 2001
From: Zoe <62722391+juls0730@users.noreply.github.com>
Date: Mon, 2 Mar 2026 00:12:01 -0600
Subject: [PATCH] feat: improve file upload and diplay stuff
---
app/components/Attachment/Display.vue | 58 ++++++--
app/components/Attachment/Preview.vue | 2 +-
app/components/ChatInput.vue | 9 +-
app/components/FileSelector.vue | 190 ++++++++++++++++++++------
4 files changed, 200 insertions(+), 59 deletions(-)
diff --git a/app/components/Attachment/Display.vue b/app/components/Attachment/Display.vue
index 115e74d..8a8da56 100644
--- a/app/components/Attachment/Display.vue
+++ b/app/components/Attachment/Display.vue
@@ -4,17 +4,59 @@ const props = defineProps<{
id: string;
name: string;
mimeType: string;
- status?: 'pending' | 'uploaded';
+ status?: 'uploading' | 'uploaded' | 'error';
url: string;
+ progress?: number;
}
}>();
+
+const isImage = computed(() => props.file.mimeType.startsWith('image/'));
+const isVideo = computed(() => props.file.mimeType.startsWith('video/'));
+const isAudio = computed(() => props.file.mimeType.startsWith('audio/'));
+const isPdf = computed(() => props.file.mimeType === 'application/pdf');
+
+const fileIcon = computed(() => {
+ if (isImage.value) return 'i-mynaui-image';
+ if (isVideo.value) return 'i-mynaui-video';
+ if (isAudio.value) return 'i-mynaui-music';
+ if (isPdf.value) return 'i-tabler-file-type-pdf';
+ if (props.file.mimeType.includes('text')) return 'i-mynaui-file-text';
+ if (props.file.mimeType.includes('zip') || props.file.mimeType.includes('archive')) return 'i-mynaui-archive';
+ return 'i-mynaui-file';
+});
+
+const fileExtension = computed(() => {
+ const parts = props.file.name.split('.');
+ return parts.length > 1 ? parts.pop()?.toUpperCase() : 'FILE';
+});
-
-
-
-
\ No newline at end of file
+
{{ props.file.name }}
+{{ fileExtension }}
+