import './demo14.css';
import Pagination from '../../pagination';
import React from 'react';
import ReactDOM from 'react-dom';
import Table from '..';
const dataSource = j => {
    const result = [];
    for (let i = 0; i < 5; i++) {
        result.push({
            title: {
                name: `Quotation for 1PCS Nano ${3 + i}.0 controller compatible`,
            },
            id: 100306660940 + i + j,
            time: 2000 + j,
        });
    }
    return result;
}, render = (value, index, record) => {
    return React.createElement("a", { href: "javascript:;" },
        "Remove(",
        record.id,
        ")"); // eslint-disable-line
};
class App extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            loading: false,
            dataSource: dataSource(5),
        };
        this.onChange = currentPage => {
            this.setState({
                loading: true,
            });
            setTimeout(() => {
                this.setState({
                    dataSource: dataSource(currentPage * 5),
                    loading: false,
                });
            }, 200);
        };
    }
    render() {
        return (React.createElement("div", null,
            React.createElement(Table, { dataSource: this.state.dataSource, loading: this.state.loading },
                React.createElement(Table.Column, { title: "Id1", dataIndex: "id", width: 140 }),
                React.createElement(Table.Column, { title: "Time", dataIndex: "time", width: 500 }),
                React.createElement(Table.Column, { cell: render, width: 200 })),
            React.createElement(Pagination, { onChange: this.onChange, className: "page-demo" })));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('table-demo-14'));
