chore: update frontend configuration
This commit is contained in:
@@ -10,8 +10,12 @@
|
||||
<IconLucideCloudUpload class="w-10 h-10 text-primary" aria-hidden="true" />
|
||||
|
||||
<div>
|
||||
<h3 class="font-semibold">{{ title }}</h3>
|
||||
<p class="text-sm text-gray-500">{{ subtitle }}</p>
|
||||
<h3 class="font-semibold">
|
||||
{{ title }}
|
||||
</h3>
|
||||
<p class="text-sm text-gray-500">
|
||||
{{ subtitle }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap justify-center gap-2">
|
||||
@@ -28,7 +32,7 @@
|
||||
:accept="accept"
|
||||
:multiple="multiple"
|
||||
@change="onFileChange"
|
||||
/>
|
||||
>
|
||||
|
||||
<ul v-if="selectedFiles.length" class="mt-4 w-full space-y-2 text-left">
|
||||
<li v-for="file in selectedFiles" :key="file.name" class="flex items-center justify-between text-sm">
|
||||
@@ -62,28 +66,28 @@ import IconLucideCloudUpload from '~icons/lucide/cloud-upload'
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: 'Ajouter des documents',
|
||||
default: 'Ajouter des documents'
|
||||
},
|
||||
subtitle: {
|
||||
type: String,
|
||||
default: 'Formats acceptés : PDF, images, textes…',
|
||||
default: 'Formats acceptés : PDF, images, textes…'
|
||||
},
|
||||
accept: {
|
||||
type: String,
|
||||
default: '',
|
||||
default: ''
|
||||
},
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
default: true
|
||||
},
|
||||
modelValue: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
default: () => []
|
||||
},
|
||||
maxFileSizeMb: {
|
||||
type: Number,
|
||||
default: 200,
|
||||
},
|
||||
default: 200
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(['update:modelValue', 'files-added'])
|
||||
@@ -166,7 +170,7 @@ const removeFile = (fileToRemove) => {
|
||||
}
|
||||
|
||||
const formatSize = (size) => {
|
||||
if (!size) return '0 B'
|
||||
if (!size) { return '0 B' }
|
||||
const units = ['B', 'KB', 'MB', 'GB']
|
||||
const index = Math.floor(Math.log(size) / Math.log(1024))
|
||||
const formatted = size / Math.pow(1024, index)
|
||||
|
||||
Reference in New Issue
Block a user