diff --git a/src/pages/notification/component/ListNotification.jsx b/src/pages/notification/component/ListNotification.jsx
index 96cba0f..a959cd9 100644
--- a/src/pages/notification/component/ListNotification.jsx
+++ b/src/pages/notification/component/ListNotification.jsx
@@ -47,7 +47,7 @@ const transformNotificationData = (apiData) => {
return apiData.map((item, index) => ({
id: `notification-${item.notification_error_id}-${index}`, // Unique key prefix with array index
type: item.is_read ? 'resolved' : item.is_delivered ? 'warning' : 'critical',
- title: item.device_name || 'Unknown Device',
+ title: item.error_code_name || 'Unknown Error',
issue: item.error_code || item.error_code_name || 'Unknown Error',
description: `${item.error_code} - ${item.error_code_name || ''}`,
timestamp: item.created_at
@@ -324,7 +324,6 @@ const ListNotification = memo(function ListNotification(props) {
borderColor: notification.isRead ? '#f0f0f0' : '#d6e4ff',
cursor: 'pointer',
}}
- onClick={() => handleMarkAsRead(notification.id)}
>
{
};
};
+// Dummy data baru untuk user history
+const getDummyUsers = (notification) => {
+ if (!notification) return [];
+ return [
+ {
+ id: '1',
+ name: 'John Doe',
+ phone: '081234567890',
+ status: 'delivered',
+ },
+ {
+ id: '2',
+ name: 'Jane Smith',
+ phone: '082345678901',
+ status: 'sent',
+ },
+ {
+ id: '3',
+ name: 'Bob Johnson',
+ phone: '083456789012',
+ status: 'failed',
+ },
+ {
+ id: '4',
+ name: 'Alice Brown',
+ phone: '084567890123',
+ status: 'delivered',
+ },
+ ];
+};
+
+const getStatusTag = (status) => {
+ switch (status) {
+ case 'delivered':
+ return
} color="success">Delivered;
+ case 'sent':
+ return
} color="processing">Sent;
+ case 'failed':
+ return
Failed;
+ default:
+ return
{status};
+ }
+};
+
const getIconAndColor = (type) => {
switch (type) {
case 'critical':
@@ -262,14 +309,6 @@ const NotificationDetailTab = () => {
Back to notification list
-
-
}
- onClick={() => setModalContent('user')}
- >
- User History
-
-
{
- {/* Kolom Kanan: Log History */}
+ {/* Kolom Kanan: User History */}
-
+
+
+
+ {getDummyUsers(notification).map((user) => (
+
+
+
+
+ } />
+
+
+
+
+
+ {getStatusTag(user.status)}
+ }
+ size="small"
+ onClick={(e) => {
+ e.stopPropagation();
+ console.log(`Resend to ${user.name}`);
+ }}
+ >
+ Resend
+
+
+
+
+
+ ))}
+
+
+
@@ -432,6 +510,7 @@ const NotificationDetailTab = () => {
setModalContent('user')}
>