import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
var _excluded = ["children", "header", "footer", "reversedOrder", "noMaxWidth", "noMarginTop", "fullPage", "threeColumns", "className", "containerClassName", "as"];
import * as React from 'react';
import classNames from 'classnames';

var Layout = function Layout(_ref) {
  var children = _ref.children,
      header = _ref.header,
      footer = _ref.footer,
      reversedOrder = _ref.reversedOrder,
      noMaxWidth = _ref.noMaxWidth,
      noMarginTop = _ref.noMarginTop,
      fullPage = _ref.fullPage,
      threeColumns = _ref.threeColumns,
      className = _ref.className,
      containerClassName = _ref.containerClassName,
      _ref$as = _ref.as,
      Type = _ref$as === void 0 ? 'div' : _ref$as,
      props = _objectWithoutProperties(_ref, _excluded);

  var layoutClass = classNames('sg-layout', className, {
    'sg-layout--three-columns': threeColumns
  });
  var layoutContainerClass = classNames('sg-layout__container', containerClassName, {
    'sg-layout__container--reversed-order': reversedOrder,
    'sg-layout__container--no-max-width': noMaxWidth,
    'sg-layout__container--no-margin-top': noMarginTop,
    'sg-layout__container--full-page': fullPage
  });
  var footerContent;

  if (footer !== undefined) {
    footerContent = /*#__PURE__*/React.createElement("div", {
      className: "sg-layout__footer"
    }, footer);
  }

  return /*#__PURE__*/React.createElement(Type, _extends({}, props, {
    className: layoutClass
  }), header, /*#__PURE__*/React.createElement("div", {
    className: layoutContainerClass
  }, children), footerContent);
};

export default Layout;