model-navigator-standalone
Version:
Standalone MDF graph model visualizer
52 lines • 2.02 kB
JavaScript
import "core-js/modules/esnext.iterator.constructor.js";
import "core-js/modules/esnext.iterator.map.js";
/* eslint-disable react/prefer-stateless-function */
import React, { useContext } from "react";
import { useSelector } from "react-redux";
import _ from 'lodash';
import withStyles from '@mui/styles/withStyles';
import { defaultStyleAttributes } from '../../../Config/nav.config';
import DataDictionaryNode from "../DataDictionaryNode";
import styles from "./DataDictionaryCategory.style";
import { ConfigContext } from '../../../Config/ConfigContext';
const DataDictionaryCategory = _ref => {
let {
classes,
category,
nodes
} = _ref;
const config = useContext(ConfigContext);
const categoryStyles = config.tagAttribute('Category', category) ? config.tagAttribute('Category', category) : defaultStyleAttributes;
const categoryColor = categoryStyles.color;
const background = categoryStyles.node.background ? categoryStyles.node.background : categoryStyles.color;
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
style: {
borderLeftColor: categoryColor,
minHeight: '44px',
background,
display: 'flex',
alignItems: 'center',
color: "#ffffff",
paddingLeft: '20px',
gap: '8px'
}
}, /*#__PURE__*/React.createElement("img", {
src: categoryStyles.table.icon,
alt: "icon",
style: {
width: '32px'
}
}), category ? /*#__PURE__*/React.createElement("div", {
className: classes.title
}, /*#__PURE__*/React.createElement("span", null, _.capitalize(category), " ")) : /*#__PURE__*/React.createElement(React.Fragment, null)), /*#__PURE__*/React.createElement("div", {
style: {
borderLeftColor: categoryColor
}
}), nodes.map(node => /*#__PURE__*/React.createElement(DataDictionaryNode, {
node: node,
key: node.handle,
category: config.legendTag,
description: node.desc
})));
};
export default withStyles(styles)(DataDictionaryCategory);