@modern-kit/react
Version:
19 lines (15 loc) • 502 B
JavaScript
;
var jsxRuntime = require('react/jsx-runtime');
const getConditionResult = (condition) => {
return typeof condition === "function" ? condition() : condition;
};
const IfElse = ({
condition,
truthyComponent,
falsyComponent
}) => {
const conditionResult = getConditionResult(condition);
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: conditionResult ? truthyComponent : falsyComponent });
};
exports.IfElse = IfElse;
//# sourceMappingURL=index.cjs.map