main repo

This commit is contained in:
Basilosaurusrex
2025-11-24 18:09:40 +01:00
parent b636ee5e70
commit f027651f9b
34146 changed files with 4436636 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import React from "react";
import { NoSSR } from "./dynamic-no-ssr";
function Loadable(options) {
const opts = Object.assign({
loader: null,
loading: null,
ssr: true
}, options);
opts.lazy = /*#__PURE__*/ React.lazy(opts.loader);
function LoadableComponent(props) {
const Loading = opts.loading;
const fallbackElement = /*#__PURE__*/ React.createElement(Loading, {
isLoading: true,
pastDelay: true,
error: null
});
const Wrap = opts.ssr ? React.Fragment : NoSSR;
const Lazy = opts.lazy;
return /*#__PURE__*/ React.createElement(React.Suspense, {
fallback: fallbackElement
}, /*#__PURE__*/ React.createElement(Wrap, null, /*#__PURE__*/ React.createElement(Lazy, props)));
}
LoadableComponent.displayName = "LoadableComponent";
return LoadableComponent;
}
export default Loadable;
//# sourceMappingURL=loadable.js.map