mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
26 lines
568 B
JavaScript
26 lines
568 B
JavaScript
|
|
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;
|
|
}
|
|
|
|
let cls = 'label label-success label-bgp-community ';
|
|
return (<span className={cls}>{readableCommunity}</span>);
|
|
}
|
|
}
|
|
|
|
export default connect(
|
|
(state) => ({
|
|
communities: state.config.bgp_communities,
|
|
})
|
|
)(Label);
|
|
|