import React from 'react'; import PropTypes from 'prop-types'; import { Utils } from '../../../utils/utils.js'; import { siteRoot, gettext } from '../../../utils/constants'; const RepoItemPropTypes = { repo: PropTypes.object.isRequired, showDeleteRepoDialog: PropTypes.func.isRequired, }; class RepoItem extends React.Component { constructor(props) { super(props); this.state = { highlight: false, }; } onMouseEnter = () => { this.setState({ highlight: true }); } onMouseLeave = () => { this.setState({ highlight: false }); } render() { const repo = this.props.repo; const highlight = this.state.highlight; let iconUrl = Utils.getLibIconUrl(repo); return ( {gettext('icon')}/ {repo.name} {Utils.bytesToSize(repo.size)}{' '} ); } } RepoItem.propTypes = RepoItemPropTypes; export default RepoItem;