"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useDeprecationWarning = void 0;

var _react = require("react");

var formatDeprecationWarning = function formatDeprecationWarning(componentName, removalAtVersion, replacementComponent) {
  return "\nDEPRECATION WARNING:\n================================\n\nThe ".concat(componentName, " component is deprecated and will be removed from Patchwork in ").concat(removalAtVersion !== null && removalAtVersion !== void 0 ? removalAtVersion : 'a future release', ".\n\n").concat((replacementComponent === null || replacementComponent === void 0 ? void 0 : replacementComponent.length) ? "Please use ".concat(replacementComponent, " instead.") : 'Please visit the Patchwork storybook for advice on alternatives.', "\n");
};

var useDeprecationWarning = function useDeprecationWarning(componentName, removalAtVersion, replacementComponent) {
  (0, _react.useEffect)(function () {
    if (process.env.NODE_ENV !== 'production') {
      // eslint-disable-next-line no-console
      console.warn(formatDeprecationWarning(componentName, removalAtVersion, replacementComponent));
    }
  }, [componentName, removalAtVersion, replacementComponent]);
};

exports.useDeprecationWarning = useDeprecationWarning;