From 7e5105392c9a846cf21db7115b8111ca66fe312c Mon Sep 17 00:00:00 2001 From: Iqbal Rizqi Kurniawan Date: Tue, 25 Nov 2025 10:22:55 +0700 Subject: [PATCH] feat: add activity log functionality with log history display and input for new logs --- .../IndexDetailNotification.jsx | 126 +++++++++++++++++- 1 file changed, 123 insertions(+), 3 deletions(-) diff --git a/src/pages/detailNotification/IndexDetailNotification.jsx b/src/pages/detailNotification/IndexDetailNotification.jsx index 0cd67a9..66f177b 100644 --- a/src/pages/detailNotification/IndexDetailNotification.jsx +++ b/src/pages/detailNotification/IndexDetailNotification.jsx @@ -80,6 +80,37 @@ const DetailNotificationTab = () => { const [loading, setLoading] = useState(true); const [error, setError] = useState(null); const [modalContent, setModalContent] = useState(null); // 'user', 'log', atau null + const [isAddingLog, setIsAddingLog] = useState(false); + + const logHistoryData = [ + { + id: 1, + timestamp: '04-11-2025 11:55 WIB', + addedBy: { + name: 'Budi Santoso', + phone: '081122334455', + }, + description: 'Suhu sudah coba diturunkan, namun masih belum mencapai treshold aman.', + }, + { + id: 2, + timestamp: '04-11-2025 11:45 WIB', + addedBy: { + name: 'John Doe', + phone: '081234567890', + }, + description: 'Suhu sudah coba diturunkan, namun masih belum mencapai treshold aman.', + }, + { + id: 3, + timestamp: '04-11-2025 11:40 WIB', + addedBy: { + name: 'Jane Smith', + phone: '087654321098', + }, + description: 'Suhu sudah coba diturunkan, namun masih belum mencapai treshold aman.', + }, + ]; useEffect(() => { const fetchDetail = async () => { @@ -212,9 +243,98 @@ const DetailNotificationTab = () => { - Error 303.pdflihat disini SOP Kompresor.pdflihat disini -
AvailableAir FilterFilters incoming air to remove dust.
- setModalContent('log')}>View Logs}>
Click 'View Logs' to see the full activity history.
+ + + + + Error 303.pdf + lihat disini + + + SOP Kompresor.pdf + lihat disini + + + + + + + + + + +
+ +
+ Available + + + Air Filter + Filters incoming air to remove dust. + +
+
+
+
+ + + + + + + {isAddingLog && ( + <> + + Add New Log / Update Progress + + + + )} + + + + {logHistoryData.map((log) => ( + + + {log.addedBy.name}:{' '} + {log.description} + + + {log.timestamp} + + + ))} + + +