2017-05-16 13:34:00 +02:00
|
|
|
|
|
|
|
import React from 'react'
|
|
|
|
import {connect} from 'react-redux'
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Show current neighbour if selected
|
|
|
|
* This should help to create a breadcrumb style navigation
|
|
|
|
* in the header.
|
|
|
|
*/
|
|
|
|
class ProtocolName extends React.Component {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<span className="status-protocol">
|
|
|
|
{this.props.protocol.description}
|
|
|
|
</span>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
(state, props) => {
|
2017-05-24 11:40:48 +02:00
|
|
|
let rsProtocols = state.routeservers.protocols[props.routeserverId]||[];
|
|
|
|
let protocol = rsProtocols.filter((p) => {
|
|
|
|
return p.id == props.protocolId;
|
|
|
|
})[0]||{};
|
2017-05-16 13:34:00 +02:00
|
|
|
return {
|
|
|
|
protocol: protocol
|
|
|
|
};
|
|
|
|
}
|
|
|
|
)(ProtocolName);
|