import React from 'react'; import { connect } from 'react-redux'; import classNames from 'classnames'; import Tooltip from './tooltip'; const Plugin = ({ id, label, description, status }) => { const error = status !== 'ok'; const className = classNames({ error }); const tip = ( Description: {description}
Status: {' '} {status}
); // Inner span to hold styling so we don't effect the "before:content" return ( {error && } {label || id} ); }; class Plugins extends React.Component { render() { const hasPlugins = this.props.plugins && this.props.plugins.size > 0; return (
Plugins: {hasPlugins && this.props.plugins.toIndexedSeq().map(plugin => Plugin(plugin.toJS()))} {!hasPlugins && n/a}
); } } function mapStateToProps(state) { return { plugins: state.get('plugins') }; } export default connect(mapStateToProps)(Plugins);