"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/asyncToGenerator"),t=require("@babel/runtime/regenerator"),r=require("react"),a=require("../../types.js"),n=require("../utils.js"),u=require("./sharedHooks.js");require("../../../../utils/index.js");var s=require("../../../../utils/notificationToasts.js");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=i(e),c=i(t);exports.useUpdateTemplateName=function(){var e=u.useGet("set"),t=u.useGet("get");return r.useCallback(function(){var r=o.default(c.default.mark((function r(u,i){var o;return c.default.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o=n.findTemplate(t,u),r.next=3,n.updateTemplate(t,e,u,{name:i},a.Action.UpdateName);case 3:r.sent&&o&&s.showSuccessNotification('"'.concat(o.name,'" was renamed to "').concat(i,'"'));case 5:case"end":return r.stop()}}),r)})));return function(e,t){return r.apply(this,arguments)}}(),[t,e])};
//# sourceMappingURL=useUpdateTemplateName.js.map
