2018-08-09 23:24:58 +02:00
|
|
|
|
|
|
|
import React from 'react'
|
|
|
|
import {connect} from 'react-redux'
|
|
|
|
|
|
|
|
|
|
|
|
class Label extends React.Component {
|
|
|
|
render() {
|
|
|
|
console.log(this.props.communities, this.props.community);
|
|
|
|
// Lookup communities
|
|
|
|
const readableCommunity = this.props.communities[this.props.community];
|
|
|
|
if (!readableCommunity) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2018-09-06 15:47:02 +02:00
|
|
|
let cls = 'label label-success label-bgp-community ';
|
2018-08-09 23:24:58 +02:00
|
|
|
return (<span className={cls}>{readableCommunity}</span>);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
(state) => ({
|
|
|
|
communities: state.config.bgp_communities,
|
|
|
|
})
|
|
|
|
)(Label);
|
|
|
|
|