import React, { Component } from 'react';
import { Table } from 'antd'

const data = [{
	key: '1',
	name: 'John Brown',
	age: 32,
	address: 'New York No. 1 Lake Park',
}, {
	key: '2',
	name: 'Jim Green',
	age: 42,
	address: 'London No. 1 Lake Park',
}, {
	key: '3',
	name: 'Joe Black',
	age: 32,
	address: 'Sidney No. 1 Lake Park',
}, {
	key: '4',
	name: 'Jim Red',
	age: 32,
	address: 'London No. 2 Lake Park',
}];

class AnswerList extends Component {
	constructor(props) {
		super(props)
	}
	handleChange = (pagination, filters, sorter) => {
		this.setState({
			sortedInfo: sorter,
		});
	}
	render() {
		const columns = [{
			title: 'Name',
			dataIndex: 'name',
			key: 'name'
		}, {
			title: '点赞数',
			dataIndex: 'age',
			key: 'age',
			sorter: (a, b) => a.age - b.age,

		}, {
			title: 'Address',
			dataIndex: 'address',
			key: 'address',
		}];
		return <Table columns={columns} dataSource={data} onChange={this.handleChange} />
	}
}

export default AnswerList;
