import React, { useCallback, useEffect, useState } from "react";
import { Modal, Form, message, Table } from "antd";
import * as API from '../../api';

interface Props{
    visible:boolean;
    roles?:API.Roles[];
    onRefresh: () => void;
    onCancel?: () => void;
}
const { Column } = Table;

function RolesModel({visible, roles, onRefresh, onCancel}:Props) {
    return (
      <Modal
        title="授权角色"
        visible={visible}
        onCancel={onCancel}
      >
        <Table
          dataSource={roles}
          rowKey={(item: API.Roles) => `${item.roleCode}`}

        >
          <Column title="角色名称" width={200} dataIndex="roleName" render={(t) => t || "-"} />
        </Table>  
      </Modal>
    );
}

export default RolesModel;