import _objectWithoutProperties from 'babel-runtime/helpers/objectWithoutProperties';
import _classCallCheck from 'babel-runtime/helpers/classCallCheck';
import _createClass from 'babel-runtime/helpers/createClass';
import _possibleConstructorReturn from 'babel-runtime/helpers/possibleConstructorReturn';
import _inherits from 'babel-runtime/helpers/inherits';
var _jsxFileName = 'src/panel/Panel.jsx';
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { renderElement } from './util';

/**
 * Panel
 * */

var Panel = function (_React$PureComponent) {
    _inherits(Panel, _React$PureComponent);

    function Panel() {
        _classCallCheck(this, Panel);

        return _possibleConstructorReturn(this, (Panel.__proto__ || Object.getPrototypeOf(Panel)).apply(this, arguments));
    }

    _createClass(Panel, [{
        key: 'render',
        value: function render() {
            var _props = this.props,
                prefixCls = _props.prefixCls,
                className = _props.className,
                children = _props.children,
                other = _objectWithoutProperties(_props, ['prefixCls', 'className', 'children']);

            var classes = classNames(prefixCls, {}, className);

            return React.createElement(
                'div',
                Object.assign({ className: classes }, other, {
                    __source: {
                        fileName: _jsxFileName,
                        lineNumber: 35
                    },
                    __self: this
                }),
                renderElement(children)
            );
        }
    }]);

    return Panel;
}(React.PureComponent);

Panel.propTypes = {
    /**
     * 类名前缀： 默认为ne-panel
     * */
    prefixCls: PropTypes.string,
    /**
     * 传入类名
     * */
    className: PropTypes.string,
    /**
     * 传入子元素
     * */
    children: PropTypes.node
};
Panel.defaultProps = {
    prefixCls: 'ne-panel'
};


export default Panel;