import React from 'react'; import { Map as makeMap } from 'immutable'; import sortBy from 'lodash/sortBy'; import MatchedText from '../matched-text'; import NodeDetailsControlButton from './node-details-control-button'; import ShowMore from '../show-more'; export default class NodeDetailsLabels extends React.Component { constructor(props, context) { super(props, context); this.DEFAULT_LIMIT = 5; this.state = { limit: this.DEFAULT_LIMIT, }; this.handleLimitClick = this.handleLimitClick.bind(this); this.renderControls = this.renderControls.bind(this); } handleLimitClick() { const limit = this.state.limit ? 0 : this.DEFAULT_LIMIT; this.setState({limit}); } renderControls(controls) { return (