UNPKG

fui-fancyui

Version:
22 lines (21 loc) 639 B
import { create as m } from "../../../../node_modules/zustand/esm/react.js"; function n() { return m((t) => ({ modals: [], openModal: ({ id: s, children: a, footer: o, header: e, config: l }) => t((d) => ({ modals: [...d.modals, { id: s, children: a, status: "open", config: l, footer: o, header: e }] })), closeModal: (s) => { t((a) => ({ modals: a.modals.map((o) => o.id === s ? { ...o, status: "closing" } : o) })), setTimeout(() => { t((a) => ({ modals: a.modals.filter((o) => o.id !== s) })); }, 300); } })); } export { n as createFancyModalStore };