import React from 'react';
import ReactDOM from 'react-dom';
import Table from '..';
const dataSource = j => {
    const result = [];
    for (let i = 0; i < j; i++) {
        result.push({
            title: {
                name: `Quotation for 1PCS Nano ${3 + i}.0 controller compatible`,
            },
            id: `100306660940${i}`,
            time: 2000 + i,
            index: i,
        });
    }
    return result;
};
const render = (value, index, record) => {
    return React.createElement("a", null,
        "Remove(",
        record.id,
        ")");
};
class App extends React.Component {
    constructor() {
        super(...arguments);
        this.state = {
            scrollToRow: 20,
        };
        this.onBodyScroll = start => {
            this.setState({
                scrollToRow: start,
            });
        };
    }
    render() {
        return (React.createElement(Table, { dataSource: dataSource(200), maxBodyHeight: 400, useVirtual: true, scrollToRow: this.state.scrollToRow, onBodyScroll: this.onBodyScroll },
            React.createElement(Table.Column, { title: "Id1", dataIndex: "id", width: 100 }),
            React.createElement(Table.Column, { title: "Index", dataIndex: "index", width: 200 }),
            React.createElement(Table.Column, { title: "Time", dataIndex: "time", width: 200 }),
            React.createElement(Table.Column, { title: "Time", dataIndex: "time", width: 200 }),
            React.createElement(Table.Column, { title: "Time", dataIndex: "time", width: 200, lock: "right" }),
            React.createElement(Table.Column, { cell: render, width: 200, lock: true })));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('table-demo-16'));
