document types

This commit is contained in:
2025-10-31 00:13:16 +01:00
parent 3941ec61d3
commit 813ce24aeb
19 changed files with 1714 additions and 43 deletions
+8 -1
View File
@@ -3,6 +3,8 @@ import { DownloadIcon, TextScanIcon, AnalyzeIcon, CloseIcon } from '../ui/icons'
import { describeDocumentSummary } from '../documents/documentSummary';
import { createDocumentActionState } from '../documents/documentActions';
const resolveDocumentTypeName = (doc) => doc?.document_type?.name;
const PreviewWorkspace = ({
document,
previewEntry,
@@ -19,6 +21,7 @@ const PreviewWorkspace = ({
const tags = Array.isArray(document.tags)
? document.tags.map((tag) => tag?.label).filter(Boolean).join(', ')
: '';
const documentTypeName = resolveDocumentTypeName(document);
const formatDateTime = (value) => {
if (!value) {
@@ -33,11 +36,15 @@ const PreviewWorkspace = ({
{ label: 'Archive Reference', value: document.archive_serial || '—' },
{ label: 'Issued On', value: formatDateTime(document.issued_at) },
{ label: 'Correspondent', value: correspondents || '—' },
{ label: 'Document Type', value: document.document_type || '—' },
{ label: 'Document Type', value: documentTypeName || '—' },
{
label: 'Filename',
value: document.archive_path || document.filename || '—',
},
{
label: 'Original Filename',
value: document.original_name || '—',
},
{ label: 'Tags', value: tags || '—' },
];