mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-04 18:51:17 +00:00
25 lines
670 B
JavaScript
25 lines
670 B
JavaScript
import React from 'react';
|
|
|
|
export default class Plugins extends React.Component {
|
|
renderPlugin(plugin) {
|
|
return (
|
|
<span className="plugins-plugin" key={plugin.id} title={plugin.description}>
|
|
{plugin.label || plugin.id}
|
|
</span>
|
|
);
|
|
}
|
|
|
|
render() {
|
|
const hasPlugins = this.props.plugins && this.props.plugins.length > 0;
|
|
return (
|
|
<div className="plugins">
|
|
<span className="plugins-label">
|
|
Plugins:
|
|
</span>
|
|
{hasPlugins && this.props.plugins.map((plugin, index) => this.renderPlugin(plugin, index))}
|
|
{!hasPlugins && <span className="plugins-empty">n/a</span>}
|
|
</div>
|
|
);
|
|
}
|
|
}
|