Refactor duplicated site forms and requirements

This commit is contained in:
MatthieuTD
2025-09-25 12:01:28 +02:00
parent ac0687ac8f
commit a4840c454f
11 changed files with 545 additions and 496 deletions

View File

@@ -89,7 +89,7 @@
<span v-else class="text-gray-400">Non défini</span>
</div>
</td>
<td>{{ formatDate(document.createdAt) }}</td>
<td>{{ formatFrenchDate(document.createdAt) }}</td>
<td class="text-right">
<div class="flex justify-end gap-2">
<button
@@ -120,6 +120,7 @@ import { ref, computed, onMounted } from 'vue'
import { useDocuments } from '~/composables/useDocuments'
import { getFileIcon } from '~/utils/fileIcons'
import { canPreviewDocument } from '~/utils/documentPreview'
import { formatFrenchDate } from '~/utils/date'
import DocumentPreviewModal from '~/components/DocumentPreviewModal.vue'
import IconLucideFileSearch from '~icons/lucide/file-search'
@@ -178,15 +179,6 @@ const formatSize = (size) => {
const documentIcon = (doc) => getFileIcon({ name: doc.filename || doc.name, mime: doc.mimeType })
const formatDate = (date) => {
if (!date) return '—'
return new Intl.DateTimeFormat('fr-FR', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
}).format(new Date(date))
}
const downloadDocument = (doc) => {
if (!doc?.path) return