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