import React from 'react'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { Utils } from '../../utils/utils'; const propTypes = { currentItem: PropTypes.object, onItemClick: PropTypes.func.isRequired, onSearchedItemDoubleClick: PropTypes.func.isRequired, item: PropTypes.object, }; class SearchedListItem extends React.Component { constructor(props) { super(props); this.state = { highlight: false, }; } onMouseEnter = () => { this.setState({ highlight: true }); }; onMouseLeave = () => { this.setState({ highlight: false }); }; onClick = () => { let item = this.props.item; this.props.onItemClick(item); }; searchItemDoubleClick = (e) => { let item = this.props.item; this.props.onSearchedItemDoubleClick(item); }; render() { let { item, currentItem } = this.props; return ( {item.is_dir ? : } {item.repo_name}/{item.link_content} ); } } SearchedListItem.propTypes = propTypes; export default SearchedListItem;