import React, { memo, useState, useEffect } from 'react'; import { Space, Tag, ConfigProvider, Button, Row, Col, Card, Input } from 'antd'; import { PlusOutlined, EditOutlined, DeleteOutlined, EyeOutlined, SearchOutlined, } from '@ant-design/icons'; import { NotifAlert, NotifConfirmDialog } from '../../../../components/Global/ToastNotif'; import { useNavigate } from 'react-router-dom'; import { deletePlantSection, getAllPlantSection } from '../../../../api/master-plant-section'; import TableList from '../../../../components/Global/TableList'; const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ { title: 'No', key: 'no', width: '5%', align: 'center', render: (_, __, index) => index + 1, }, { title: 'Plant Sub Section Code', dataIndex: 'plant_sub_section_code', key: 'plant_sub_section_code', width: '10%', align: 'center', hidden: true, }, { title: 'Plant Sub Section Name', dataIndex: 'plant_sub_section_name', key: 'plant_sub_section_name', width: '15%', }, { title: 'Description', dataIndex: 'plant_sub_section_description', key: 'plant_sub_section_description', width: '30%', render: (text) => text || '-', }, { title: 'Status', dataIndex: 'is_active', key: 'is_active', width: '10%', align: 'center', render: (_, { is_active }) => ( <> {is_active === true ? ( Running ) : ( Offline )} ), }, { title: 'Action', key: 'aksi', align: 'center', width: '15%', render: (_, record) => ( } size="large" /> ); }); export default ListPlantSubSection;