import React from 'react';
import classnames from 'classnames';
var defaultProps = {
    prefixCls: 'ty-switch',
    size: 'md',
};
var Switch = function (props) {
    var _a;
    var checked = props.checked, size = props.size, disabled = props.disabled, loading = props.loading, onChange = props.onChange, checkedText = props.checkedText, uncheckedText = props.uncheckedText, prefixCls = props.prefixCls, className = props.className, style = props.style;
    var cls = classnames(prefixCls, className, prefixCls + "_" + size, (_a = {},
        _a[prefixCls + "_checked"] = checked,
        _a[prefixCls + "_loading"] = loading,
        _a[prefixCls + "_disabled"] = loading || disabled,
        _a));
    var _onClick = function (e) {
        !(disabled || loading) && onChange && onChange(!checked, e);
    };
    return (React.createElement("label", { className: cls, style: style, onClick: _onClick },
        React.createElement("span", { className: prefixCls + "__bg" },
            React.createElement("span", { className: prefixCls + "__thumb" }),
            React.createElement("span", { className: prefixCls + "__label" }, checked ? checkedText : uncheckedText))));
};
Switch.defaultProps = defaultProps;
export default Switch;
//# sourceMappingURL=index.js.map