UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

32 lines (29 loc) 911 B
'use client'; import { ModalProvider } from "./ModalProvider.mjs"; import { memo } from "react"; import { jsx } from "react/jsx-runtime"; //#region src/Modal/RawModalStackItem.tsx const RawModalStackItem = memo(({ component: Component, id, onClose, onUpdate, open, options, props }) => { const close = () => onClose(id); const setCanDismissByClickOutside = (value) => { onUpdate(id, { maskClosable: value }); }; const contextValue = { close, setCanDismissByClickOutside }; const openKey = options?.openKey ?? "open"; const onCloseKey = options?.onCloseKey ?? "onClose"; return /* @__PURE__ */ jsx(ModalProvider, { value: contextValue, children: /* @__PURE__ */ jsx(Component, { ...props, [onCloseKey]: close, [openKey]: open }) }); }); RawModalStackItem.displayName = "RawModalStackItem"; //#endregion export { RawModalStackItem }; //# sourceMappingURL=RawModalStackItem.mjs.map