import { h } from 'preact'; import PropTypes from 'prop-types'; /* global timeAgo */ function userProfilePage(username) { const str = `/${username}`; return str; } export const CommentListItem = ({ comment }) => (
{ if (_event.which > 1 || _event.metaKey || _event.ctrlKey) { // Indicates should open in _blank window.open(comment.path, '_blank'); } else { const fullUrl = window.location.origin + comment.path; // InstantClick deals with full urls InstantClick.preload(fullUrl); InstantClick.display(fullUrl); } }} >
{`{comment.username} {comment.name}
); CommentListItem.displayName = 'CommentsListItem'; CommentListItem.propTypes = { comment: PropTypes.shape({ name: PropTypes.string.isRequired, profile_image_90: PropTypes.string.isRequired, published_at_int: PropTypes.number.isRequired, safe_processed_html: PropTypes.string.isRequired, path: PropTypes.string.isRequired, username: PropTypes.string.isRequired, }).isRequired, };