import './demo3.css';
import Nav from '..';
import Radio from '../../radio';
import React from 'react';
import ReactDOM from 'react-dom';
import Switch from '../../switch';
const { Item, SubNav } = Nav;
class App extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            collapse: false,
            embeddable: false,
        };
        this.onChange = val => {
            this.setState({
                collapse: val,
            });
        };
        this.changeEmbeddable = embeddable => {
            this.setState({
                embeddable,
            });
        };
    }
    render() {
        const { collapse, embeddable } = this.state;
        let iconOnly, mode;
        if (collapse) {
            iconOnly = true;
            mode = 'popup';
        }
        else {
            iconOnly = false;
            mode = 'inline';
        }
        return (React.createElement("div", null,
            React.createElement(Switch, { defaultChecked: false, onChange: this.onChange, size: "small" }),
            React.createElement("div", { className: "demo-ctl" },
                React.createElement(Radio.Group, { shape: "button", size: "medium", value: embeddable, onChange: this.changeEmbeddable },
                    React.createElement(Radio, { value: true }, "embeddable=true"),
                    React.createElement(Radio, { value: false }, "embeddable=false"))),
            React.createElement(Nav, { style: { width: '200px' }, embeddable: embeddable, defaultOpenAll: true, defaultSelectedKeys: ['0-1'], iconOnly: iconOnly, hasArrow: false, hasTooltip: true, mode: mode, type: "primary" },
                React.createElement(Item, { icon: "calendar" }, " Schedule "),
                React.createElement(Item, { icon: "email" }, " Email "),
                React.createElement(Item, { icon: "help" }, " Help "),
                React.createElement(SubNav, { icon: "set", label: "Settings" },
                    React.createElement(Item, { icon: "account" }, " Account "),
                    React.createElement(Item, { icon: "exit" }, " Exit ")))));
    }
}
ReactDOM.render(React.createElement(App, null), document.getElementById('nav-demo-3'));
