"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _ = require("./..");

// Style
var classes = {};
/* istanbul ignore next */

if (typeof window !== 'undefined') classes = require("./style.module.scss");

var ModalHeader = function ModalHeader(_ref) {
  var children = _ref.children,
      className = _ref.className,
      toggleClose = _ref.toggleClose,
      attrs = (0, _objectWithoutProperties2["default"])(_ref, ["children", "className", "toggleClose"]);
  return /*#__PURE__*/_react["default"].createElement("header", (0, _extends2["default"])({
    className: [classes['Modal-Header'], className || ''].join(' ')
  }, attrs), /*#__PURE__*/_react["default"].createElement(_.Flex, {
    align: "center",
    justify: "between"
  }, children, toggleClose && /*#__PURE__*/_react["default"].createElement("button", {
    className: classes['Modal-Header-Close'],
    onClick: toggleClose,
    type: "button"
  }, /*#__PURE__*/_react["default"].createElement("i", {
    className: "fa fa-times-circle"
  }))));
};

ModalHeader.propTypes = {
  children: _propTypes["default"].any,
  className: _propTypes["default"].node,
  toggleClose: _propTypes["default"].func
};
var _default = ModalHeader;
exports["default"] = _default;