@primer/react
Version:
An implementation of GitHub's Primer Design System using React
53 lines (49 loc) • 1.08 kB
JavaScript
var reactCompilerRuntime = require('react-compiler-runtime');
var Box = require('../../Box/Box.js');
var jsxRuntime = require('react/jsx-runtime');
const ConditionalWrapper = props => {
const $ = reactCompilerRuntime.c(8);
let condition;
let rest;
if ($[0] !== props) {
({
if: condition,
...rest
} = props);
$[0] = props;
$[1] = condition;
$[2] = rest;
} else {
condition = $[1];
rest = $[2];
}
if (condition) {
let t0;
if ($[3] !== props.children || $[4] !== rest) {
t0 = /*#__PURE__*/jsxRuntime.jsx(Box, {
...rest,
children: props.children
});
$[3] = props.children;
$[4] = rest;
$[5] = t0;
} else {
t0 = $[5];
}
return t0;
} else {
let t0;
if ($[6] !== props.children) {
t0 = /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
children: props.children
});
$[6] = props.children;
$[7] = t0;
} else {
t0 = $[7];
}
return t0;
}
};
exports.ConditionalWrapper = ConditionalWrapper;
;