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, NotifOk, NotifConfirmDialog } from '../../../components/Global/ToastNotif'; import { useNavigate } from 'react-router-dom'; import { getAllRole, deleteRole } from '../../../api/role'; import TableList from '../../../components/Global/TableList'; const columns = (showPreviewModal, showEditModal, showDeleteDialog) => [ { title: 'No', key: 'no', width: '5%', align: 'center', render: (_, __, index) => index + 1, }, { title: 'ID', dataIndex: 'role_id', key: 'role_id', width: '5%', hidden: true, }, { title: 'Nama Role', dataIndex: 'role_name', key: 'role_name', width: '25%', }, { title: 'Level', dataIndex: 'role_level', key: 'role_level', width: '10%', align: 'center', }, { title: 'Deskripsi', dataIndex: 'role_description', key: 'role_description', width: '35%', }, { title: 'Status', dataIndex: 'is_active', key: 'is_active', width: '10%', align: 'center', render: (_, { is_active }) => ( <> {is_active === true ? ( Active ) : ( Inactive )} ), }, { title: 'Aksi', key: 'aksi', align: 'center', width: '15%', render: (_, record) => ( } size="large" /> ); }); export default ListRole;