diff --git a/frontend/src/features/documents/mobile/DocumentsMobileScreen.tsx b/frontend/src/features/documents/mobile/DocumentsMobileScreen.tsx
index 5924465..56040e8 100644
--- a/frontend/src/features/documents/mobile/DocumentsMobileScreen.tsx
+++ b/frontend/src/features/documents/mobile/DocumentsMobileScreen.tsx
@@ -200,7 +200,7 @@ export const DocumentsMobileScreen: React.FC = () => {
-
+
{upload.isPending && currentId === doc.id && (
{upload.progress}%
diff --git a/frontend/src/features/documents/pages/DocumentDetailPage.tsx b/frontend/src/features/documents/pages/DocumentDetailPage.tsx
index ce78f40..7cf4d5a 100644
--- a/frontend/src/features/documents/pages/DocumentDetailPage.tsx
+++ b/frontend/src/features/documents/pages/DocumentDetailPage.tsx
@@ -27,6 +27,25 @@ export const DocumentDetailPage: React.FC = () => {
const vehiclesMap = useMemo(() => new Map(vehicles?.map(v => [v.id, v]) || []), [vehicles]);
+ // Check if document has displayable metadata
+ const hasDisplayableMetadata = useMemo(() => {
+ if (!doc) return false;
+ const details = doc.details || {};
+
+ if (doc.documentType === 'insurance') {
+ return !!(doc.expirationDate || details.policyNumber || details.insuranceCompany ||
+ doc.issuedDate || details.bodilyInjuryPerson || details.bodilyInjuryIncident ||
+ details.propertyDamage || details.premium);
+ }
+ if (doc.documentType === 'registration') {
+ return !!(doc.expirationDate || details.licensePlate || details.cost);
+ }
+ if (doc.documentType === 'manual') {
+ return !!(doc.issuedDate || doc.notes);
+ }
+ return false;
+ }, [doc]);
+
const handleDownload = async () => {
if (!id) return;
const blob = await documentsApi.download(id);
@@ -167,7 +186,7 @@ export const DocumentDetailPage: React.FC = () => {
{getVehicleLabel(vehicle)}
-
+ {hasDisplayableMetadata && }
@@ -262,11 +281,13 @@ export const DocumentDetailPage: React.FC = () => {
)}
- {/* Type-specific Metadata */}
-
+ {/* Type-specific Metadata - only show if there's data */}
+ {hasDisplayableMetadata && (
+
+ )}
{/* Actions */}
diff --git a/frontend/src/features/documents/pages/DocumentsPage.tsx b/frontend/src/features/documents/pages/DocumentsPage.tsx
index fad99ae..f45464c 100644
--- a/frontend/src/features/documents/pages/DocumentsPage.tsx
+++ b/frontend/src/features/documents/pages/DocumentsPage.tsx
@@ -158,7 +158,7 @@ export const DocumentsPage: React.FC = () => {
)}
-
+