({ post, onLinkClick }: PostProps)
| 52 | const textContainerClassName = 'flex flex-col ml-3 mr-2 flex-1'; |
| 53 | |
| 54 | const DefaultListItem = ({ post, onLinkClick }: PostProps): ReactElement => { |
| 55 | const trendingDescription = getTrendingDescription(post.trending); |
| 56 | return ( |
| 57 | <article |
| 58 | className={classNames( |
| 59 | 'group relative -mx-4 flex items-start px-4 py-3 hover:bg-surface-hover', |
| 60 | styles.card, |
| 61 | )} |
| 62 | > |
| 63 | <Link href={getPostPath(post)} passHref prefetch={false}> |
| 64 | <CardLink title={post.title} {...combinedClicks(onLinkClick)} /> |
| 65 | </Link> |
| 66 | <LazyImage |
| 67 | imgSrc={post.source?.image ?? ''} |
| 68 | imgAlt={post.source?.name ?? ''} |
| 69 | className={imageClassName} |
| 70 | /> |
| 71 | <div className={textContainerClassName}> |
| 72 | <h5 |
| 73 | className={classNames( |
| 74 | 'multi-truncate mb-0.5 text-ellipsis break-words text-text-primary typo-callout', |
| 75 | styles.title, |
| 76 | )} |
| 77 | > |
| 78 | {post.title} |
| 79 | </h5> |
| 80 | {trendingDescription ? ( |
| 81 | <div className="flex items-center text-text-tertiary typo-footnote"> |
| 82 | <HotLabel /> |
| 83 | <div className="ml-2">{trendingDescription}</div> |
| 84 | </div> |
| 85 | ) : ( |
| 86 | <PostEngagementCounts |
| 87 | upvotes={post.numUpvotes ?? 0} |
| 88 | comments={post.numComments ?? 0} |
| 89 | className="text-text-tertiary" |
| 90 | /> |
| 91 | )} |
| 92 | </div> |
| 93 | </article> |
| 94 | ); |
| 95 | }; |
| 96 | |
| 97 | const DefaultListItemPlaceholder = (): ReactElement => ( |
| 98 | <article aria-busy className="relative -mx-4 flex items-start px-4 py-3"> |
nothing calls this directly
no test coverage detected