From e9ef970d48a5cc67b38415aff13d6e6823a52b9d Mon Sep 17 00:00:00 2001 From: Tatjana Date: Thu, 23 Apr 2026 21:24:45 +0200 Subject: [PATCH] fix: add loading indicator and empty state for activity log, warn on unsaved changes --- frontend/src/pages/CaseDetail.jsx | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/frontend/src/pages/CaseDetail.jsx b/frontend/src/pages/CaseDetail.jsx index a3e67cb..28dfe5b 100644 --- a/frontend/src/pages/CaseDetail.jsx +++ b/frontend/src/pages/CaseDetail.jsx @@ -414,15 +414,27 @@ const CaseDetail = ({ caseData, onBack, onGoToPet, currentUserId, userRole, onDi

Logg & Historik

-
- {timeline.filter(item => item.type === 'ACTIVITY').map((log) => ( -
-
-

{log.description}

-

{new Date(log.createdAt).toLocaleString('sv-SE')}

+ {loading ? ( +
+
+ Laddar... +
+ ) : (() => { + const activityLogs = timeline.filter(item => item.type === 'ACTIVITY'); + return activityLogs.length === 0 ? ( +

Ingen aktivitet ännu

+ ) : ( +
+ {activityLogs.map((log) => ( +
+
+

{log.description}

+

{new Date(log.createdAt).toLocaleString('sv-SE')}

+
+ ))}
- ))} -
+ ); + })()}