diff --git a/src/pages/master/device/component/ListDevice.jsx b/src/pages/master/device/component/ListDevice.jsx
index 6e5404e..39b535f 100644
--- a/src/pages/master/device/component/ListDevice.jsx
+++ b/src/pages/master/device/component/ListDevice.jsx
@@ -33,7 +33,7 @@ import ExcelJS from 'exceljs';
import { saveAs } from 'file-saver';
import logoPiEnergi from '../../../../assets/images/logo/pi-energi.png';
-const columns = (items, handleClickMenu) => [
+const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [
{
title: 'ID',
dataIndex: 'device_id',
@@ -89,18 +89,26 @@ const columns = (items, handleClickMenu) => [
title: 'Aksi',
key: 'aksi',
align: 'center',
- width: '5%',
+ width: '15%',
render: (_, record) => (
- handleClickMenu(key, record),
- }}
- trigger={['click']}
- placement="bottomRight"
- >
- } />
-
+
+ }
+ onClick={() => showPreviewModal(record)}
+ />
+ }
+ onClick={() => showEditModal(record)}
+ />
+ }
+ onClick={() => showDeleteDialog(record)}
+ />
+
),
},
];
@@ -277,44 +285,6 @@ const ListDevice = memo(function ListDevice(props) {
saveAs(new Blob([buffer]), 'Data_APD.xlsx');
};
- const handleClickMenu = (key, record) => {
- switch (key) {
- case 'preview':
- showPreviewModal(record);
- break;
-
- case 'edit':
- showEditModal(record);
- break;
-
- case 'delete':
- showDeleteDialog(record);
- break;
-
- default:
- break;
- }
- };
-
- const menu = [
- {
- key: 'preview',
- label: Preview,
- icon: ,
- },
- {
- key: 'edit',
- label: Edit,
- icon: ,
- },
- {
- key: 'delete',
- label: Delete,
- icon: ,
- danger: true,
- },
- ];
-
return (
@@ -385,7 +355,7 @@ const ListDevice = memo(function ListDevice(props) {