mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-13 13:50:07 +00:00
28 lines
850 B
JavaScript
28 lines
850 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import classnames from 'classnames';
|
|
import { Utils } from '../../utils/utils';
|
|
|
|
function SearchResultLibrary(props) {
|
|
const { item, isHighlight, onClick } = props;
|
|
return (
|
|
<li
|
|
className={classnames('search-result-item', { 'search-result-item-highlight': isHighlight })}
|
|
onClick={() => onClick(item)}
|
|
ref={ref => props.setRef(ref)}
|
|
>
|
|
<img className='lib-item-img' src={Utils.getDefaultLibIconUrl(true)} alt="" />
|
|
<div className="item-content d-flex justify-content-between align-items-center ellipsis">{item.name}</div>
|
|
</li>
|
|
);
|
|
}
|
|
|
|
SearchResultLibrary.propTypes = {
|
|
item: PropTypes.object.isRequired,
|
|
onClick: PropTypes.func.isRequired,
|
|
isHighlight: PropTypes.bool,
|
|
setRef: PropTypes.func,
|
|
};
|
|
|
|
export default SearchResultLibrary;
|