import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["image", "backgroundContent", "children", "className"],
    _excluded2 = ["children"];
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { settings } from '../../globals/js';
var prefix = settings.prefix;
export default function AuthLayout(_ref) {
  var _classNames;

  var image = _ref.image,
      backgroundContent = _ref.backgroundContent,
      children = _ref.children,
      className = _ref.className,
      other = _objectWithoutProperties(_ref, _excluded);

  var style = image ? {
    backgroundImage: "url(".concat(image, ")")
  } : {};
  var wrapperClasses = classNames("".concat(prefix, "--auth-background-wrapper"), (_classNames = {}, _defineProperty(_classNames, "".concat(prefix, "--auth-background-image"), image), _defineProperty(_classNames, "".concat(className), className), _classNames));
  return /*#__PURE__*/React.createElement("div", _extends({
    className: "".concat(prefix, "--auth-wrapper")
  }, other), /*#__PURE__*/React.createElement("div", {
    className: wrapperClasses,
    style: style
  }, backgroundContent), /*#__PURE__*/React.createElement("div", {
    className: "".concat(prefix, "--auth-content-wrapper")
  }, children));
}
AuthLayout.propTypes = {
  /**
   * The content usually consisting out of forms
   */
  children: PropTypes.node.isRequired,

  /**
   * The image is set as background on the left section when provided
   */
  image: PropTypes.node,

  /**
   * This usually consist of `<BackgroundContent/>` if you wish to provide content and background color instead of an image
   */
  backgroundContent: PropTypes.node,

  /**
   * The CSS class name to be placed on the wrapping element.
   */
  className: PropTypes.string
};
export function BackgroundContent(_ref2) {
  var children = _ref2.children,
      other = _objectWithoutProperties(_ref2, _excluded2);

  return /*#__PURE__*/React.createElement("div", _extends({}, other, {
    className: "".concat(prefix, "--auth-background-content")
  }), children);
}
BackgroundContent.propTypes = {
  /**
   * The content usually consisting out of `<BackgroundContent/>`
   */
  children: PropTypes.node.isRequired,

  /**
   * The CSS class name to be placed on the wrapping element.
   */
  className: PropTypes.string
};