@primer/react
Version:
An implementation of GitHub's Primer Design System using React
44 lines (43 loc) • 897 B
JavaScript
import { c } from "react-compiler-runtime";
import { Fragment, jsx } from "react/jsx-runtime";
//#region src/internal/components/ConditionalWrapper.tsx
const ConditionalWrapper = (props) => {
const $ = c(9);
let children;
let condition;
let rest;
if ($[0] !== props) {
({if: condition, children, ...rest} = props);
$[0] = props;
$[1] = children;
$[2] = condition;
$[3] = rest;
} else {
children = $[1];
condition = $[2];
rest = $[3];
}
if (condition) {
let t0;
if ($[4] !== children || $[5] !== rest) {
t0 = /*#__PURE__*/ jsx("div", {
...rest,
children
});
$[4] = children;
$[5] = rest;
$[6] = t0;
} else t0 = $[6];
return t0;
} else {
let t0;
if ($[7] !== children) {
t0 = /*#__PURE__*/ jsx(Fragment, { children });
$[7] = children;
$[8] = t0;
} else t0 = $[8];
return t0;
}
};
//#endregion
export { ConditionalWrapper };