var _jsxFileName = 'src/modal/ModalHeader.jsx',
    _this = this;

/**
 * ModalHeader.jsx
 *
 * @Author: jruif
 * @Date: 2017/7/7 下午10:02
 */

import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { hasChildren } from '../util/isType';
import Button from '../button';
/**
 * @ignore
 * */
var ModalHeader = function ModalHeader(props) {
    var children = props.children,
        _props$prefixCls = props.prefixCls,
        prefixCls = _props$prefixCls === undefined ? 'ne-modal' : _props$prefixCls,
        className = props.className,
        _props$onClose = props.onClose,
        onClose = _props$onClose === undefined ? function () {} : _props$onClose,
        hasCloseBtnOnHeader = props.hasCloseBtnOnHeader;

    var classes = classNames(prefixCls + '-header', className);

    return React.createElement(
        'div',
        { className: classes, __source: {
                fileName: _jsxFileName,
                lineNumber: 21
            },
            __self: _this
        },
        React.createElement(
            'h4',
            {
                __source: {
                    fileName: _jsxFileName,
                    lineNumber: 22
                },
                __self: _this
            },
            hasChildren(children) ? children : ''
        ),
        hasCloseBtnOnHeader && React.createElement(Button, { icon: 'cancel-1', className: prefixCls + '-close', onClick: onClose, size: 'small', shape: 'none', __source: {
                fileName: _jsxFileName,
                lineNumber: 24
            },
            __self: _this
        })
    );
};

ModalHeader.propTypes = {
    content: PropTypes.string,
    children: PropTypes.node,
    className: PropTypes.string,
    onClose: PropTypes.func
};

ModalHeader.displayName = 'NeatUI.ModalHeader';

export default ModalHeader;