import Radio from '..';
import React from 'react';
import ReactDOM from 'react-dom';
import Switch from '../../switch';
class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            isPreview: true,
            checked: true,
        };
        this.togglePreview = () => {
            this.setState({
                isPreview: !this.state.isPreview,
            });
        };
        this.toggleCheck = () => {
            this.setState({
                checked: !this.state.checked,
            });
        };
        this.renderChecked = (checked, props) => (checked ? React.createElement("span", null, props.children) : React.createElement("span", null, "null"));
        this.renderPreview = previewed => React.createElement("span", null, previewed.label);
    }
    render() {
        return (React.createElement(React.Fragment, null,
            "toggle checked:",
            React.createElement(Switch, { size: "small", defaultChecked: true, onChange: this.toggleCheck, style: { verticalAlign: 'middle', marginRight: 30 } }),
            "toggle isPreview:",
            ' ',
            React.createElement(Switch, { size: "small", defaultChecked: true, onChange: this.togglePreview, style: { verticalAlign: 'middle' } }),
            React.createElement("br", null),
            React.createElement("br", null),
            React.createElement("span", { style: { fontSize: 14 } }, "Single: "),
            React.createElement(Radio, { className: "radio-preview-inline", checked: this.state.checked, 
                // @ts-ignore
                isPreview: this.state.isPreview, renderPreview: this.renderChecked }, "Radio"),
            React.createElement("br", null),
            React.createElement("span", { style: { fontSize: 14 } }, "Group: "),
            React.createElement(Radio.Group, { className: "radio-group-preview-inlline", name: "radio", defaultValue: 'react', 
                // @ts-ignore
                isPreview: this.state.isPreview, renderPreview: this.renderPreview },
                React.createElement(Radio, { value: "react" }, "React"),
                React.createElement(Radio, { value: "vue" }, "Vue"),
                React.createElement(Radio, { value: "angular" }, "Angular"))));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('radio-demo-5'));
// .radio-preview-inline {
//   display: inline-block;
//   margin-left: 8px;
//   line-height: 40px;
// }
// .radio-group-preview-inlline {
//   display: inline-block;
//   margin-left: 8px;
//   line-height: 40px;
// }
