fui-fancyui
Version:
FancyUI Libary
28 lines (27 loc) • 1.18 kB
JavaScript
"use client";
import { jsxs as n, jsx as t } from "react/jsx-runtime";
import { forwardRef as u, useEffect as y } from "react";
import g from "../../atoms/FancyXButton/FancyXButton.js";
import a from "../../atoms/Typography/Typography.js";
import h from "../../atoms/SystemMessageBox/SystemMessageBox.js";
import { Headline as T, TimerLine as x, Background as B } from "./SingleToastMessage.style.js";
const C = u((m, c) => {
const { id: r, title: l, message: d, time: i, themeType: o, layer: s, ...f } = m.toast, e = m.remove;
return y(() => {
const p = setTimeout(() => {
e == null || e(r);
}, i);
return () => clearTimeout(p);
}, [r, i, e]), /* @__PURE__ */ n(h, { ref: c, sizeC: "md", themeType: o, layer: s, ...f, children: [
/* @__PURE__ */ n(T, { children: [
/* @__PURE__ */ t(a, { variant: "interactiveMd", fontWeight: "bold", children: l }),
/* @__PURE__ */ t(g, { onClick: () => e == null ? void 0 : e(r), themeType: o })
] }),
/* @__PURE__ */ t(a, { variant: "bodytextSm", children: d }),
/* @__PURE__ */ t(x, { $time: i, $messageType: o, $layer: s }),
/* @__PURE__ */ t(B, {})
] });
});
export {
C as default
};