diff --git a/src/pages/notification/component/DetailNotification.jsx b/src/pages/notification/component/DetailNotification.jsx index d86ff09..19a1e81 100644 --- a/src/pages/notification/component/DetailNotification.jsx +++ b/src/pages/notification/component/DetailNotification.jsx @@ -14,8 +14,9 @@ const DetailNotification = memo(function DetailNotification({ selectedData, onCl // Get error code data from the nested structure const errorCodeData = selectedData.error_code; - const solutionData = errorCodeData?.solution?.[0] || {}; - const sparepartsData = errorCodeData?.spareparts || []; + // Get active solution (is_active: true) or first solution + const activeSolution = errorCodeData?.solution?.find(sol => sol.is_active) || errorCodeData?.solution?.[0] || {}; + const sparepartsData = selectedData.spareparts || errorCodeData?.spareparts || []; // Determine notification type based on is_read status const getTypeFromStatus = () => { @@ -137,7 +138,7 @@ const DetailNotification = memo(function DetailNotification({ selectedData, onCl Solusi