diff --git a/ui/src/hosts/components/HostsTable.js b/ui/src/hosts/components/HostsTable.js index bd0494272..5ed775c6a 100644 --- a/ui/src/hosts/components/HostsTable.js +++ b/ui/src/hosts/components/HostsTable.js @@ -1,9 +1,10 @@ import React, {PropTypes} from 'react' import {Link} from 'react-router' import _ from 'lodash' - import shallowCompare from 'react-addons-shallow-compare' import classnames from 'classnames' + +import SearchBar from 'src/hosts/components/SearchBar' import {HOSTS_TABLE} from 'src/hosts/constants/tableSizing' const {arrayOf, bool, number, shape, string} = PropTypes @@ -244,46 +245,4 @@ const HostRow = React.createClass({ }, }) -const SearchBar = React.createClass({ - propTypes: { - onSearch: PropTypes.func.isRequired, - }, - - getInitialState() { - return { - searchTerm: '', - } - }, - - componentWillMount() { - const waitPeriod = 300 - this.handleSearch = _.debounce(this.handleSearch, waitPeriod) - }, - - handleSearch() { - this.props.onSearch(this.state.searchTerm) - }, - - handleChange() { - this.setState({searchTerm: this.refs.searchInput.value}, this.handleSearch) - }, - - render() { - return ( -