"use strict";

var _typeof = require("@babel/runtime/helpers/typeof");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.useSyncBlockActions = exports.SyncBlockActionsProvider = void 0;
var _react = _interopRequireWildcard(require("react"));
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var SyncBlockActionsContext = /*#__PURE__*/(0, _react.createContext)(null);
var useSyncBlockActions = exports.useSyncBlockActions = function useSyncBlockActions() {
  return (0, _react.useContext)(SyncBlockActionsContext);
};
var SyncBlockActionsProvider = exports.SyncBlockActionsProvider = function SyncBlockActionsProvider(_ref) {
  var children = _ref.children,
    removeSyncBlock = _ref.removeSyncBlock,
    fetchSyncBlockSourceInfo = _ref.fetchSyncBlockSourceInfo;
  var value = (0, _react.useMemo)(function () {
    return {
      deleteSyncBlock: removeSyncBlock,
      fetchSourceInfo: fetchSyncBlockSourceInfo
    };
  }, [removeSyncBlock, fetchSyncBlockSourceInfo]);
  return /*#__PURE__*/_react.default.createElement(SyncBlockActionsContext.Provider, {
    value: value
  }, children);
};