"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),t=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=r(e);exports.useSelectionToast=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3,r=t.useState(null),n=u.default(r,2),a=n[0],c=n[1],l=t.useRef(null),o=t.useCallback((function(t,r){l.current&&clearTimeout(l.current),c({message:t,variant:r}),l.current=setTimeout((function(){return c(null)}),e)}),[e]),s=t.useCallback((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"added";if(e.added>0){var r=1===e.added?"1 well ".concat(t):"".concat(e.added," wells ").concat(t);o(r,"success")}else e.attempted>0&&o("Selection limit reached","error")}),[o]);return t.useEffect((function(){return function(){l.current&&clearTimeout(l.current)}}),[]),{toast:a,showToast:o,showSelectionResult:s}};
//# sourceMappingURL=useSelectionToast.js.map
