"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Pulse = Pulse;
var _react = _interopRequireDefault(require("react"));
var _onboarding = require("@atlaskit/onboarding");
// eslint-disable-next-line @atlaskit/design-system/use-spotlight-package

/**
 * Wraps children with {@link SpotlightPulse} component.
 *
 * It adds pulse effect to children if `pulse` is `true`.
 *
 * This custom component exists because the {@link SpotlightPulse} with `pulse={false}` renders extra `div` around `children`.
 * We want to keep `children` as it is if there is no `pulse`.
 */
function Pulse(_ref) {
  var pulse = _ref.pulse,
    _ref$radius = _ref.radius,
    radius = _ref$radius === void 0 ? 3 : _ref$radius,
    children = _ref.children;
  if (pulse) {
    return (
      /*#__PURE__*/
      // SpotlightPulse shows pulse effect if `pulse` is `undefined`.
      // That's why we need to cast `pulse` to `false` if it's `undefined`.
      _react.default.createElement(_onboarding.SpotlightPulse, {
        radius: radius,
        pulse: pulse !== null && pulse !== void 0 ? pulse : false
      }, children)
    );
  }
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
}