From 88aca511e703ad300e1f37121158b63f454a2a3a Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Sun, 12 Nov 2023 19:38:42 +0000 Subject: [PATCH] Colored file size --- frontend/src/components/FileSize.vue | 39 ++++++++++++++++++---------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/frontend/src/components/FileSize.vue b/frontend/src/components/FileSize.vue index fbc0bfe..00b4658 100644 --- a/frontend/src/components/FileSize.vue +++ b/frontend/src/components/FileSize.vue @@ -6,27 +6,38 @@ import type { Document } from '@/repositories/Document' import { computed } from 'vue' -const sizeClass = computed(() => props.doc.sizedisp.split('\u202F').slice(-1)[0]) +const sizeClass = computed(() => { + const unit = props.doc.sizedisp.split('\u202F').slice(-1)[0] + return +unit ? "bytes" : unit +}) const props = defineProps<{ doc: Document }>() -