import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";

/**
 * This is mainly a Wrapper, to bulid more easely HTML Elements
 *
 */
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
export default function E(_ref) {
  let {
    className,
    class: _className,
    useClass,
    css,
    is: Tag
  } = _ref,
      rest = _objectWithoutProperties(_ref, ["className", "class", "useClass", "css", "is"]);

  return React.createElement(Tag, _extends({
    className: classnames(useClass ? useClass : "dnb-".concat(Tag), className, _className, css)
  }, rest));
}
E.propTypes = process.env.NODE_ENV !== "production" ? {
  is: PropTypes.string.isRequired,
  className: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  class: PropTypes.string,
  useClass: PropTypes.string,
  css: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
  children: PropTypes.node
} : {};
E.defaultProps = {
  className: null,
  class: null,
  useClass: null,
  css: null,
  children: null
};