import React, { Key } from 'react';
import { Row, Col, Table } from '@btri-ui/base';
import { ColumnsType } from '@btri-ui/base/src/Table';

interface DataType {
  title1: string;
  title2: string;
  title3: string;
  title4: string;
  key: Key;
}

const columns: ColumnsType<DataType> = [
  {
    title: '标题1',
    dataIndex: 'title1',
  },
  {
    title: '标题2',
    dataIndex: 'title2',
  },
  {
    title: '标题3',
    dataIndex: 'title4',
  },
  {
    title: '标题4',
    dataIndex: 'title4',
  },
];

export default () => {
  return (
    <Row autoMode={true}>
      <Col span={24}>
        <Table
          columns={columns}
          scroll={{
            y: 200,
          }}
        />
      </Col>
      <Col span={24}>
        <Table
          columns={columns}
          emptyType="slogan"
          locale={{
            emptyText: 'test',
          }}
          scroll={{
            y: 200,
          }}
        />
      </Col>
    </Row>
  );
};
