"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useSmartLinkReload = useSmartLinkReload;
var _react = require("react");
var _uuid = _interopRequireDefault(require("uuid"));
var _actions = require("../actions");
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead

/**
 * Exposes a programmatic way to reload the data being used to render a Smart Link.
 * @param
 * @returns
 */
function useSmartLinkReload(_ref) {
  var url = _ref.url;
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
  var id = (0, _react.useMemo)(function () {
    return (0, _uuid.default)();
  }, []);
  var linkActions = (0, _actions.useSmartCardActions)(id, url);
  return linkActions.reload;
}