"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.createEditorUseOnlyNotice = createEditorUseOnlyNotice;
var _react = _interopRequireDefault(require("react"));
var _sectionMessage = _interopRequireDefault(require("@atlaskit/section-message"));
function AlternativePackagesMessage(_ref) {
  var alternatePackages = _ref.alternatePackages;
  if (!alternatePackages) {
    return null;
  }
  if (alternatePackages.length === 1) {
    return /*#__PURE__*/_react.default.createElement("p", null, "Consider using", ' ', /*#__PURE__*/_react.default.createElement("a", {
      href: alternatePackages[0].link
    }, alternatePackages[0].name), ' ', "instead.");
  }
  return /*#__PURE__*/_react.default.createElement("p", null, "Consider using one of these packages instead:", /*#__PURE__*/_react.default.createElement("ul", null, alternatePackages.map(function (p) {
    return /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement("a", {
      href: p.link
    }, p.name));
  })));
}
function createEditorUseOnlyNotice(componentName, alternatePackages) {
  return /*#__PURE__*/_react.default.createElement(_sectionMessage.default, {
    title: "Internal Editor Use Only",
    appearance: "error"
  }, /*#__PURE__*/_react.default.createElement("p", null, componentName, " is intended for internal use by the Editor Platform as a plugin dependency of the Editor within your product."), /*#__PURE__*/_react.default.createElement("p", null, "Direct use of this component is not supported."), /*#__PURE__*/_react.default.createElement(AlternativePackagesMessage, {
    alternatePackages: alternatePackages
  }));
}