mirror of
https://github.com/weaveworks/scope.git
synced 2026-03-03 18:20:27 +00:00
34 lines
801 B
JavaScript
34 lines
801 B
JavaScript
import React from 'react';
|
|
import { connect } from 'react-redux';
|
|
|
|
import DetailsCard from './details-card';
|
|
|
|
class Details extends React.Component {
|
|
render() {
|
|
const { controlStatus, details } = this.props;
|
|
// render all details as cards, later cards go on top
|
|
return (
|
|
<div className="details">
|
|
{details.toIndexedSeq().map((obj, index) => (
|
|
<DetailsCard
|
|
key={obj.id}
|
|
index={index}
|
|
cardCount={details.size}
|
|
nodeControlStatus={controlStatus.get(obj.id)}
|
|
{...obj}
|
|
/>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|
|
}
|
|
|
|
function mapStateToProps(state) {
|
|
return {
|
|
controlStatus: state.get('controlStatus'),
|
|
details: state.get('nodeDetails')
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(Details);
|