UNPKG

@payfit/unity-components

Version:

29 lines (28 loc) 945 B
import { TOAST_CONFIG as e } from "./ToastManager.js"; import { ToastAction as t } from "./parts/ToastAction.js"; import { ToastContent as n } from "./parts/ToastContent.js"; import { ToastTitle as r } from "./parts/ToastTitle.js"; import { UnityToast as i } from "./UnityToast.js"; import { jsx as a, jsxs as o } from "react/jsx-runtime"; import s from "react-hot-toast"; //#region src/components/toast/toast.tsx function c({ title: c, content: l, variant: u, action: d, actionOnPress: f, duration: p, datadogPrivacy: m = "mask" }) { return s.custom((e) => /* @__PURE__ */ o(i, { onClose: () => { s.dismiss(e.id); }, variant: u, inline: !!l, "data-dd-privacy": m, children: [ /* @__PURE__ */ a(r, { children: c }), l ? /* @__PURE__ */ a(n, { children: l }) : null, d ? /* @__PURE__ */ a(t, { onPress: f, children: d }) : null ] }), { duration: p ?? e[u].duration }); } //#endregion export { c as toast };