@@ -43,6 +43,7 @@ import { usePostLabels } from '@/lib/bluesky/hooks/use-post-labels';
43
43
import { Accordion , AccordionItem , AccordionTrigger , AccordionContent } from '@radix-ui/react-accordion' ;
44
44
import { ErrorBoundary } from './error-boundary' ;
45
45
import { PostEmbed } from './post-embed' ;
46
+ import { Badge } from './ui/badge' ;
46
47
47
48
const contextToText = ( context : string ) => {
48
49
if ( context === 'following' ) return 'following' ;
@@ -248,7 +249,8 @@ function PostCardInner({ post, context, className, parent = false }: PostCardInn
248
249
// Hide post if it's filtered
249
250
if ( moderation ?. ui ( 'contentList' ) . filter ) return null ;
250
251
const contentMedia = moderation ?. ui ( 'contentMedia' ) ;
251
- const moderationLabel = contentMedia ?. blurs [ 0 ] ?. type === 'label' ? contentMedia . blurs [ 0 ] ?. labelDef . locales [ 0 ] : null ;
252
+ const moderationMediaLabel = contentMedia ?. blurs [ 0 ] ?. type === 'label' ? contentMedia . blurs [ 0 ] ?. labelDef . locales [ 0 ] : null ;
253
+ const profileLabels = moderation ?. ui ( 'profileList' ) . informs . filter ( ( label ) => label . type === 'label' ) ;
252
254
const moderationFilter = moderation ?. ui ( 'contentMedia' ) . filter ;
253
255
254
256
const onClick = ( ) => {
@@ -311,6 +313,13 @@ function PostCardInner({ post, context, className, parent = false }: PostCardInn
311
313
{ ! experiments . zenMode && < BetterContext context = { context } /> }
312
314
</ div >
313
315
</ div >
316
+ < div className = "flex gap-1 py-1" >
317
+ { profileLabels ?. map ( ( label ) => (
318
+ < Badge title = { label . labelDef . locales [ 0 ] ! . description } key = { label . label . uri } >
319
+ { label . labelDef . locales [ 0 ] ! . name }
320
+ </ Badge >
321
+ ) ) }
322
+ </ div >
314
323
< div className = "flex flex-col gap-2" >
315
324
< p className = "text-gray-800 dark:text-gray-200" >
316
325
{ translatedText ? (
@@ -327,14 +336,14 @@ function PostCardInner({ post, context, className, parent = false }: PostCardInn
327
336
) }
328
337
</ p >
329
338
< ErrorBoundary >
330
- { moderationFilter ? null : moderationLabel ? (
339
+ { moderationFilter ? null : moderationMediaLabel ? (
331
340
< Accordion type = "single" collapsible onClick = { ( event ) => event . stopPropagation ( ) } >
332
341
< AccordionItem value = "item-1" >
333
342
< AccordionTrigger className = "w-full group" >
334
343
< div className = "flex items-center space-x-2 rounded-sm hover:bg-neutral-500 hover:bg-opacity-10 gap-1 border justify-between p-2" >
335
344
< div className = "flex items-center gap-1" >
336
345
< AlertTriangleIcon size = { 20 } />
337
- { moderationLabel ?. name }
346
+ { moderationMediaLabel ?. name }
338
347
</ div >
339
348
< div className = "group-data-[state=open]:hidden" > { 'show' } </ div >
340
349
< div className = "hidden group-data-[state=open]:flex" > { 'hide' } </ div >
@@ -436,8 +445,8 @@ type PostCardProps = {
436
445
parent ?: boolean ;
437
446
} ;
438
447
439
- export const PostCard = memo ( function PostCard ( props : PostCardProps ) {
440
- if ( ! props . post ) return null ;
448
+ export const PostCard = memo ( function PostCard ( { post , ... props } : PostCardProps ) {
449
+ if ( ! post ) return null ;
441
450
442
- return < PostCardInner { ...props } /> ;
451
+ return < PostCardInner { ...props } post = { post } /> ;
443
452
} ) ;
0 commit comments