Files
weave-scope/client/app/scripts/components/node-details.js
David Kaltschmidt 7d1ee40a2b Fixed lint errors in all js files
- Also added linter configuration, and make linter fail on error
- fixing ES6 errors and added ES6 transformer
- gulp target to try local build
- linted gulpfile
- cant hook into gulp lint yet, because gulp does currently not support
  ES6 which some rules demand, since gulp cant transpile itself, we have a
  chicken and egg problem.
- ES6 transpiler for test runner
- removed old linter config
- adapted editorconfig to reflect linter config
2015-05-28 15:07:13 +00:00

44 lines
1.0 KiB
JavaScript

const React = require('react');
const NodeDetailsTable = require('./node-details-table');
const NodeColorMixin = require('../mixins/node-color-mixin');
const NodeDetails = React.createClass({
mixins: [
NodeColorMixin
],
render: function() {
const node = this.props.details;
if (!node) {
return <div className="node-details" />;
}
const style = {
'background-color': this.getNodeColorDark(node.label_major)
};
return (
<div className="node-details">
<div className="node-details-header" style={style}>
<h2 className="node-details-header-label">
{node.label_major}
</h2>
<div className="node-details-header-label-minor">{node.label_minor}</div>
</div>
<div className="node-details-content">
{this.props.details.tables.map(function(table) {
return <NodeDetailsTable title={table.title} rows={table.rows} isNumeric={table.numeric} />;
})}
</div>
</div>
);
}
});
module.exports = NodeDetails;