import React, { memo, useState, useEffect } from 'react'; import { Space, Tag, ConfigProvider, Button, Row, Col, Card, Input, Segmented } from 'antd'; import { PlusOutlined, EditOutlined, DeleteOutlined, EyeOutlined, SearchOutlined, AppstoreOutlined, TableOutlined, } from '@ant-design/icons'; import { NotifAlert, NotifOk, NotifConfirmDialog } from '../../../../components/Global/ToastNotif'; import { useNavigate } from 'react-router-dom'; import { deleteDevice, getAllDevice } from '../../../../api/master-device'; import TableList from '../../../../components/Global/TableList'; const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ { title: 'ID', dataIndex: 'device_id', key: 'device_id', width: '5%', hidden: 'true', }, { title: 'Device Code', dataIndex: 'device_code', key: 'device_code', width: '10%', }, { title: 'Device Name', dataIndex: 'device_name', key: 'device_name', width: '20%', }, { title: 'Location', dataIndex: 'device_location', key: 'device_location', width: '10%', }, { title: 'IP Address', dataIndex: 'ip_address', key: 'ip_address', width: '10%', }, { title: 'Status', dataIndex: 'is_active', key: 'is_active', width: '10%', align: 'center', render: (_, { is_active }) => ( <> {is_active === true ? ( Running ) : ( Offline )} ), }, { title: 'Aksi', key: 'aksi', align: 'center', width: '15%', render: (_, record) => ( } size="large" /> ); }); export default ListDevice;