import React from 'react'; import classNames from 'classnames'; export default class Plugins extends React.Component { renderPlugin({id, label, description, status}) { const error = status !== 'ok'; const className = classNames({ error }); const title = `Status: ${status} | Plugin description: ${description}`; // Inner span to hold styling so we don't effect the "before:content" return ( {error && } {label || id} ); } render() { const hasPlugins = this.props.plugins && this.props.plugins.length > 0; return (
Plugins: {hasPlugins && this.props.plugins.map((plugin, index) => this.renderPlugin(plugin, index))} {!hasPlugins && n/a}
); } }