import { timestampToTime } from '@/utils/dateUtil';
import { UtilsTool } from '@/utils/macd/UtilsTool';

export const columns = [
  {
    title: '排名',
    dataIndex: 'id',
    key: 'id',
  },
  {
    title: '玩家ID',
    dataIndex: 'user_id',
    key: 'user_id',
  },
  {
    title: '昵称',
    dataIndex: 'nickName',
    key: 'nickName',
  },
  {
    title: '总收益',
    dataIndex: 'score',
    key: 'score',
    render: (rows, _) => {
      if (rows.score <= 0) {
        return 0;
      }
      return UtilsTool.unitConversion(rows.score);
    },
  },
  {
    title: '注册时间',
    dataIndex: 'createtime',
    key: 'createtime',
    render: (rows, _) => {
      if (rows.createtime <= 0) {
        return '-';
      }
      return timestampToTime(rows.createtime);
    },
  },
];
