@@ -10,11 +10,10 @@ import VoteControl from "@/components/Vote/VoteControl";
1010
1111export type ContentType = "POST" | "LINK" ;
1212
13- // Display kind → chip label + tone. The card's behavior still keys off `type`
14- // (POST vs LINK); `kind` only drives the editorial chip.
15- // Every chip uses the SAME shape (see chip <span> below) and an opaque token
16- // wash background so none look offset/unanchored — only the color varies by
17- // kind. Mirrored in components/ContentDetail/TypeBadge.tsx for consistency.
13+ // Display kind → chip label + tone. Behavior keys off `type` (POST vs LINK);
14+ // `kind` only drives the editorial chip. Every chip shares the same shape + an
15+ // opaque wash so none look offset — only the color varies. Mirrored in
16+ // components/ContentDetail/TypeBadge.tsx.
1817const KIND : Record < string , { label : string ; className : string } > = {
1918 POST : { label : "Article" , className : "bg-accent/15 text-accent-soft" } ,
2019 ARTICLE : { label : "Article" , className : "bg-accent/15 text-accent-soft" } ,
@@ -61,7 +60,6 @@ export interface UnifiedContentCardProps {
6160 tags ?: string [ ] ;
6261}
6362
64- // Get relative time string
6563const getRelativeTime = ( dateStr : string ) : string => {
6664 const now = new Date ( ) ;
6765 const date = new Date ( dateStr ) ;
@@ -76,7 +74,6 @@ const getRelativeTime = (dateStr: string): string => {
7674 return date . toLocaleDateString ( "en-US" , { month : "short" , day : "numeric" } ) ;
7775} ;
7876
79- // Ensure image URL uses https
8077const ensureHttps = ( url : string | null | undefined ) : string | null => {
8178 if ( ! url ) return null ;
8279 if ( url . startsWith ( "http://" ) ) {
@@ -115,8 +112,7 @@ const UnifiedContentCard = ({
115112
116113 const imageUrl = ensureHttps ( rawImageUrl ) ;
117114
118- // Determine the URL for the card
119- // Priority: author (POST or user-created LINK) > source (aggregated LINK) > fallback
115+ // URL priority: author (POST or user-created LINK) > source (aggregated LINK) > fallback.
120116 const cardUrl =
121117 author ?. username && slug
122118 ? `/${ author . username } /${ slug } ` // User-created content (POST or LINK)
@@ -215,11 +211,8 @@ const UnifiedContentCard = ({
215211 className = "group rounded-lg border border-hairline bg-surface p-5 transition-colors duration-base ease-out hover:border-strong"
216212 data-testid = "content-card"
217213 >
218- { /* Top row: [kind chip + author + title + excerpt] · preview image
219- (top-right, aligned with the header). */ }
220214 < div className = "flex gap-4" >
221215 < div className = "min-w-0 flex-1" >
222- { /* Header: kind chip + author + @handle · time (· via source for links) */ }
223216 < div className = "flex flex-wrap items-center gap-2" >
224217 < span
225218 className = { `inline-flex items-center whitespace-nowrap rounded-sm px-2 py-0.5 font-mono text-xs ${ chip . className } ` }
@@ -312,15 +305,13 @@ const UnifiedContentCard = ({
312305 ) }
313306 </ div >
314307
315- { /* Footer: mono #tags + reaction bar */ }
316308 < div className = "mt-3 flex flex-wrap items-center gap-3" >
317309 { tags && tags . length > 0 && (
318310 < span className = "min-w-0 truncate font-mono text-xs text-faint" >
319311 { tags . map ( ( t ) => `#${ t } ` ) . join ( " " ) }
320312 </ span >
321313 ) }
322314 < div className = "ml-auto flex items-center gap-3" >
323- { /* Net-score vote pill */ }
324315 < VoteControl
325316 base = {
326317 votes . upvotes -
0 commit comments