@redocly/theme
Version:
Shared UI components lib
24 lines • 1.51 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.HandleType = void 0;
exports.CatalogEntityRelationsNode = CatalogEntityRelationsNode;
const react_1 = __importDefault(require("react"));
const CatalogEntityRelationsRootNode_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsRootNode");
const CatalogEntityRelationsLinkedNode_1 = require("../../../../components/Catalog/CatalogEntity/CatalogEntityGraph/CatalogEntityRelationsLinkedNode");
var HandleType;
(function (HandleType) {
HandleType["Target"] = "target";
HandleType["Source"] = "source";
})(HandleType || (exports.HandleType = HandleType = {}));
function CatalogEntityRelationsNode({ data, className, }) {
const { label, entityType, isRoot, entityKey } = data;
const mergedClassName = `nopan${className ? ` ${className}` : ''}`;
if (isRoot) {
return (react_1.default.createElement(CatalogEntityRelationsRootNode_1.CatalogEntityRelationsRootNode, { className: mergedClassName, label: label, entityType: entityType }));
}
return (react_1.default.createElement(CatalogEntityRelationsLinkedNode_1.CatalogEntityRelationsLinkedNode, { className: mergedClassName, label: label, entityType: entityType, to: `/catalogs/all/entities/${entityKey}` }));
}
//# sourceMappingURL=CatalogEntityRelationsNode.js.map