import React, { useState, useRef } from 'react';
import Table, { ProColumns, ActionType } from '@/components/Table';
import { getUserList } from '@/services/user/user';
import { fetchTableData } from '@/utils/table';

const UserManageList = () => {
  const tableRef = useRef<ActionType>();
  const columns: ProColumns<any>[] = [
    {
      title: '钱包地址',
      dataIndex: 'address',
      ellipsis: true,
    },
    {
      title: '登陆时间',
      dataIndex: 'last_time',
      hideInSearch: true,
      ellipsis: true,
    },
  ];
  return (
    <Table
      columns={columns}
      rowKey="id"
      actionRef={tableRef}
      request={async (params) => {
        const res = await fetchTableData(getUserList, params);
        return res;
      }}
    />
  );
};

export default UserManageList;
