import Message from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import { Radio } from '../..';
const types = ['success', 'warning', 'error', 'notice', 'loading'];
const sizeList = [
    {
        value: 'medium',
        label: 'medium',
    },
];
const shapeList = [
    {
        value: 'inline',
        label: 'inline',
    },
    {
        value: 'addon',
        label: 'addon',
    },
    {
        value: 'toast',
        label: 'toast',
    },
];
const CloseList = [
    {
        value: true,
        label: 'true',
    },
    {
        value: false,
        label: 'false',
    },
];
const ColorList = [
    {
        value: 'colorful',
        label: 'colorful',
    },
    {
        value: 'white',
        label: 'white',
    },
];
class Demo extends React.Component {
    constructor(props) {
        super(props);
        this.handleSize = size => {
            this.setState({ size });
        };
        this.handleShape = shape => {
            this.setState({ shape });
        };
        this.handleClose = closeable => {
            this.setState({ closeable });
        };
        this.handleColor = bgcolor => {
            this.setState({ bgcolor });
        };
        this.state = {
            size: 'medium',
            shape: 'inline',
            closeable: true,
            bgcolor: 'colorful',
        };
    }
    render() {
        const { size, shape, closeable, bgcolor } = this.state;
        return (React.createElement("div", null,
            React.createElement("span", { className: "demo-label" }, "Select Size\uFF1A"),
            React.createElement(Radio.Group, { defaultValue: "medium", dataSource: sizeList, value: this.state.size, onChange: this.handleSize }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement("span", { className: "demo-label" }, "Select Shape\uFF1A"),
            React.createElement(Radio.Group, { defaultValue: "inline", dataSource: shapeList, value: this.state.shape, onChange: this.handleShape }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement("span", { className: "demo-label" }, "Select Closeable\uFF1A"),
            React.createElement(Radio.Group, { defaultValue: true, 
                // @ts-ignore
                dataSource: CloseList, value: this.state.closeable, onChange: this.handleClose }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement("span", { className: "demo-label" }, "Select BgColor\uFF1A"),
            React.createElement(Radio.Group, { defaultValue: "colorful", dataSource: ColorList, value: this.state.bgcolor, onChange: this.handleColor }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement("div", { className: "message-size-shape-demo" }, types.map(type => (React.createElement("div", null,
                React.createElement(Message, { key: type, title: type, type: type, size: size, shape: shape, closeable: closeable, bgcolor: bgcolor }, "content content content content content content content content content content content content content"),
                React.createElement("br", null)))))));
    }
}
ReactDOM.render(React.createElement(Demo, null), document.getElementById('message-demo-1'));
