import Radio from '../../radio';
import React from 'react';
import ReactDOM from 'react-dom';
import Table from '..';
const dataSource = () => {
    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,
            time: 2000 + i,
        });
    }
    return result;
};
const render = (value, index, record) => {
    return React.createElement("a", { href: 'javascript:;' },
        "Remove(",
        record.id,
        ")"); // eslint-disable-line
};
class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.handleSize = size => {
            this.setState({ size });
        };
        this.state = {
            size: 'small',
        };
    }
    render() {
        const { size } = this.state;
        return (React.createElement("div", null,
            React.createElement(Radio.Group, { shape: "button", value: size, onChange: this.handleSize },
                React.createElement(Radio, { value: "xs" }, "xs"),
                React.createElement(Radio, { value: "small" }, "small"),
                React.createElement(Radio, { value: "medium" }, "medium"),
                React.createElement(Radio, { value: "large" }, "large")),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement(Table, { dataSource: dataSource(), size: size },
                React.createElement(Table.Column, { title: "Id", htmlTitle: "Unique Id", dataIndex: "id" }),
                React.createElement(Table.Column, { title: "Title", dataIndex: "title.name" }),
                React.createElement(Table.Column, { title: "Time", dataIndex: "time" }),
                React.createElement(Table.Column, { cell: render }))));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('table-demo-1'));
