import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectSpread from "@babel/runtime/helpers/objectSpread";

/**
 * Web Footer Component
 *
 */
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import { registerElement, validateDOMAttributes, processChildren } from '../../shared/component-helper'; // import './style/dnb-footer.css' // no good solution to import the style here

const renderProps = {
  render_content: null
};
export const propTypes = {
  class: PropTypes.string,

  /** React props */
  className: PropTypes.string,
  children: PropTypes.oneOfType([PropTypes.string, PropTypes.node, PropTypes.func]),
  // Web Component props
  render_content: PropTypes.func
};
export const defaultProps = _objectSpread({
  class: null,

  /** React props */
  className: null,
  children: null
}, renderProps);
export default class Footer extends PureComponent {
  static enableWebComponent() {
    registerElement(Footer.tagName, Footer, defaultProps);
  }

  static getContent(props) {
    if (typeof props.render_content === 'function') {
      return props.render_content(props);
    }

    return processChildren(props);
  }

  render() {
    const {
      className,
      class: _className
    } = this.props;
    const content = Footer.getContent(this.props);
    const params = {
      className: classnames('dnb-footer', className, _className) // also used for code markup simulation

    };
    validateDOMAttributes(this.props, params);
    return React.createElement("div", params, content);
  }

}

_defineProperty(Footer, "tagName", 'dnb-footer');

_defineProperty(Footer, "defaultProps", defaultProps);

Footer.propTypes = process.env.NODE_ENV !== "production" ? propTypes : {};