You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.3 KiB
38 lines
1.3 KiB
import Nip05AffiliationBadges from '@/components/Nip05AffiliationBadges' |
|
import { FormattedTimestamp } from '@/components/FormattedTimestamp' |
|
import EventPowLabel from '@/components/EventPowLabel' |
|
import Username from '@/components/Username' |
|
import { cn } from '@/lib/utils' |
|
import type { Event } from 'nostr-tools' |
|
|
|
/** Username, relative time, verified NIP-05 affiliation badges, optional PoW — one header row. */ |
|
export default function NoteAuthorMetaLine({ |
|
userId, |
|
timestamp, |
|
powEvent, |
|
usernameClassName, |
|
skeletonClassName, |
|
timestampShort = false |
|
}: { |
|
userId: string |
|
timestamp: number |
|
powEvent?: Event |
|
usernameClassName?: string |
|
skeletonClassName?: string |
|
timestampShort?: boolean |
|
}) { |
|
return ( |
|
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5 overflow-hidden"> |
|
<Username |
|
userId={userId} |
|
className={cn('shrink font-semibold truncate', usernameClassName)} |
|
skeletonClassName={skeletonClassName} |
|
/> |
|
<span className="inline-flex min-w-0 shrink-0 items-center gap-x-1.5 text-sm text-muted-foreground"> |
|
<FormattedTimestamp timestamp={timestamp} className="shrink-0" short={timestampShort} /> |
|
<Nip05AffiliationBadges userId={userId} /> |
|
{powEvent ? <EventPowLabel event={powEvent} /> : null} |
|
</span> |
|
</div> |
|
) |
|
}
|
|
|