Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
23 lines
547 B
Plaintext
23 lines
547 B
Plaintext
import { jsx as _jsx } from "react/jsx-runtime";
|
|
import React from 'react';
|
|
export const RenderComponent = ({
|
|
Component,
|
|
Fallback,
|
|
props = {}
|
|
}) => {
|
|
if (Array.isArray(Component)) {
|
|
return Component.map((c, index) => /*#__PURE__*/_jsx(RenderComponent, {
|
|
Component: c,
|
|
props: props
|
|
}, index));
|
|
}
|
|
if (typeof Component === 'function') {
|
|
return /*#__PURE__*/_jsx(Component, {
|
|
...props
|
|
});
|
|
}
|
|
return Fallback ? /*#__PURE__*/_jsx(Fallback, {
|
|
...props
|
|
}) : null;
|
|
};
|
|
//# sourceMappingURL=index.js.map |