@focuson/form_components
Version:
Components that can be used by @focuson/forms
10 lines (9 loc) • 488 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Guard = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
function Guard({ value, cond, children, height }) {
const display = value && (typeof cond === 'boolean' ? (value.length === 0) === cond : cond.indexOf(value.toString()) >= 0);
return display ? children : (0, jsx_runtime_1.jsx)("span", { style: { height: height ? height : '20px', display: 'flex' } });
}
exports.Guard = Guard;