/**
* RepoListItem
*
* Lists the name and the issue count of a repository
*/
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { createStructuredSelector } from 'reselect';
import { FormattedNumber } from 'react-intl';
import { makeSelectCurrentUser } from 'containers/App/selectors';
import ListItem from 'components/ListItem';
import IssueIcon from './IssueIcon';
import IssueLink from './IssueLink';
import RepoLink from './RepoLink';
import Wrapper from './Wrapper';
export function RepoListItem(props) {
const { item } = props;
let nameprefix = '';
// If the repository is owned by a different person than we got the data for
// it's a fork and we should show the name of the owner
if (item.owner.login !== props.currentUser) {
nameprefix = `${item.owner.login}/`;
}
// Put together the content of the repository
const content = (
{nameprefix + item.name}
);
// Render the content into a list item
return ;
}
RepoListItem.propTypes = {
item: PropTypes.object,
currentUser: PropTypes.string,
};
export default connect(
createStructuredSelector({
currentUser: makeSelectCurrentUser(),
}),
)(RepoListItem);