import React, { Component, PropTypes } from 'react'; import { filter } from 'lodash'; import Icon from 'components/icons/Icon'; import InputField from 'components/forms/fields/InputField'; import labelInterface from 'interfaces/label'; import PanelGroup from 'components/side_panels/HostSidePanel/PanelGroup'; import SecondarySidePanelContainer from 'components/side_panels/SecondarySidePanelContainer'; import statusLabelsInterface from 'interfaces/status_labels'; const baseClass = 'host-side-panel'; class HostSidePanel extends Component { static propTypes = { labels: PropTypes.arrayOf(labelInterface), onAddLabelClick: PropTypes.func, onLabelClick: PropTypes.func, selectedLabel: labelInterface, statusLabels: statusLabelsInterface, }; constructor (props) { super(props); this.state = { labelFilter: '' }; } onFilterLabels = (labelFilter) => { const lowerLabelFilter = labelFilter.toLowerCase(); this.setState({ labelFilter: lowerLabelFilter }); return false; } render () { const { labels, onAddLabelClick, onLabelClick, selectedLabel, statusLabels } = this.props; const { labelFilter } = this.state; const { onFilterLabels } = this; const allHostLabels = filter(labels, { type: 'all' }); const hostStatusLabels = filter(labels, { type: 'status' }); const hostPlatformLabels = filter(labels, { type: 'platform' }); const customLabels = filter(labels, (label) => { const lowerDisplayText = label.display_text.toLowerCase(); return label.type === 'custom' && lowerDisplayText.match(labelFilter); }); return (


LABELS

); } } export default HostSidePanel;