'use client';
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var jsxRuntime=require("react/jsx-runtime"),React=require("react"),core=require("@gem-sdk/core"),CloseIcon=require("./icons/CloseIcon.js");const Notify=React.forwardRef((e,t)=>{let{style:r,className:s,duration:i=4.5,eventKey:o,content:a,closable:c,props:n,type:u,onClick:g,onNoticeClose:p}=e,[l,d]=React.useState(!1),x=React.useRef(),f=React.useCallback(()=>{p?.(o)},[p,o]);return React.useEffect(()=>{!l&&i&&(x.current=setTimeout(()=>{f()},1e3*i));let e=x.current;return()=>{e&&clearTimeout(e)}},[i,l,f]),jsxRuntime.jsxs("div",{"aria-hidden":!0,...n,ref:t,className:core.cls("gp-flex gp-gap-2 gp-rounded gp-px-4 gp-py-2 gp-shadow-md",{"gp-bg-g-info gp-text-white":"info"===u,"gp-bg-g-success gp-text-white":"success"===u,"gp-bg-g-error gp-text-white":"error"===u,"gp-bg-g-warning gp-text-white":"warning"===u,"gp-bg-white gp-text-black":"default"===u||!u},s),style:r,onMouseEnter:()=>{d(!0)},onMouseLeave:()=>{d(!1)},onClick:g,children:[jsxRuntime.jsx("div",{children:a}),c&&jsxRuntime.jsx("button",{tabIndex:0,onClick:e=>{e.preventDefault(),e.stopPropagation(),f()},children:jsxRuntime.jsx(CloseIcon.default,{className:"gp-w-4"})})]})});Notify.displayName="Notify",exports.default=Notify;
