@adyen/adyen-platform-experience-web
Version:

26 lines (25 loc) • 978 B
JavaScript
import { jsx as u } from "../../external/preact/jsx-runtime/dist/jsxRuntime.module.js";
import { toChildArray as d } from "../../external/preact/dist/preact.module.js";
import { useMemo as e, useEffect as p } from "../../external/preact/hooks/dist/hooks.module.js";
import { CoreContext as y } from "./CoreContext.js";
import C from "../../hooks/useBooleanState.js";
import x from "../Localization/Localization.js";
const z = ({
i18n: o = new x().i18n,
children: a,
commonProps: r,
loadingContext: t,
updateCore: s,
externalErrorHandler: m,
componentRef: n
}) => {
const [c, f] = C(!1), i = e(() => r || {}, [r]), l = e(() => t ?? "", [t]);
return p(() => {
(async () => {
await (o == null ? void 0 : o.ready), f(!0);
})().catch();
}, []), c ? /* @__PURE__ */ u(y.Provider, { value: { i18n: o, commonProps: i, loadingContext: l, updateCore: s, externalErrorHandler: m, componentRef: n }, children: d(a) }) : null;
};
export {
z as default
};