import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import PropTypes from 'prop-types';
export var DangerousHTML =
/*#__PURE__*/
function (_React$Component) {
  _inheritsLoose(DangerousHTML, _React$Component);

  function DangerousHTML() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = DangerousHTML.prototype;

  _proto.render = function render() {
    var _this$props = this.props,
        children = _this$props.children,
        testAutomationId = _this$props.testAutomationId,
        props = _objectWithoutPropertiesLoose(_this$props, ["children", "testAutomationId"]);

    if (testAutomationId) {
      props['data-test-automation-id'] = testAutomationId;
    }

    if (typeof children === 'string') {
      props.dangerouslySetInnerHTML = {
        __html: children
      };
    } else {
      props.children = children;
    }

    return React.createElement("div", _extends({
      className: "inline-block"
    }, props));
  };

  return DangerousHTML;
}(React.Component);

_defineProperty(DangerousHTML, "propTypes", {
  children: PropTypes.node.isRequired,
  testAutomationId: PropTypes.string
});

_defineProperty(DangerousHTML, "defaultProps", {
  testAutomationId: null
});