import _defineProperty from 'babel-runtime/helpers/defineProperty';
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/panelHeader.jsx';
/**
 * header.jsx
 *
 * @Author: apple
 * @Date: 2018/1/29 18:00
 */

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';

/**
 * Panel.Header
 * */

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

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

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

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

            var tabsClass = prefixCls + '-tab';
            var classes = classNames(prefixCls, _defineProperty({}, tabsClass, type === 'tab'), className);
            return React.createElement(
                'div',
                Object.assign({ className: classes }, other, {
                    __source: {
                        fileName: _jsxFileName,
                        lineNumber: 49
                    },
                    __self: this
                }),
                children
            );
        }
    }]);

    return PanelHeader;
}(React.PureComponent);

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


export default PanelHeader;