import e from"@babel/runtime/helpers/slicedToArray";import{useState as t,useRef as r,useCallback as n,useEffect as o}from"react";var c=function(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2e3,a=t(null),u=e(a,2),l=u[0],i=u[1],d=r(null),s=n((function(e,t){d.current&&clearTimeout(d.current),i({message:e,variant:t}),d.current=setTimeout((function(){return i(null)}),c)}),[c]),m=n((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);s(r,"success")}else e.attempted>0&&s("Selection limit reached","error")}),[s]);return o((function(){return function(){d.current&&clearTimeout(d.current)}}),[]),{toast:l,showToast:s,showSelectionResult:m}};export{c as useSelectionToast};
//# sourceMappingURL=useSelectionToast.js.map
