@moxb/stellar-router-react
Version:
Stellar router: React widgets
17 lines (16 loc) • 1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.BoundNavLink = void 0;
var tslib_1 = require("tslib");
var React = require("react");
var mobx_react_lite_1 = require("mobx-react-lite");
var util_1 = require("@moxb/util");
var NavLink_1 = require("./NavLink");
exports.BoundNavLink = (0, mobx_react_lite_1.observer)(function (props) {
var operation = props.operation, children = props.children, rest = (0, tslib_1.__rest)(props, ["operation", "children"]);
if (operation.invisible) {
return null;
}
var linkProps = (0, tslib_1.__assign)({ to: operation.to, argChanges: operation.argChanges, position: operation.position, appendTokens: operation.appendTokens, removeTokenCount: operation.removeTokenCount, label: operation.label, toRef: operation.toRef, title: operation.help, disabled: (0, util_1.readDecision)(operation.disabled) }, rest);
return React.createElement(NavLink_1.NavLink, (0, tslib_1.__assign)({}, linkProps), children);
});