- Feed bounded context with DDD implementation (Phases 1-5) - Domain event handlers for cross-context coordination - Fix Blossom media upload setting persistence - Fix wallet connection persistence on page reload - New branding assets and icons - Vitest testing infrastructure with 151 domain model tests - Help page scaffolding - Keyboard navigation provider 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
816 B
TypeScript
24 lines
816 B
TypeScript
import { Pubkey } from '@/domain'
|
|
import { useFollowList } from '@/providers/FollowListProvider'
|
|
import { UserRoundCheck } from 'lucide-react'
|
|
import { useMemo } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
|
|
export default function FollowingBadge({ pubkey, userId }: { pubkey?: string; userId?: string }) {
|
|
const { t } = useTranslation()
|
|
const { followingSet } = useFollowList()
|
|
const isFollowing = useMemo(() => {
|
|
if (pubkey) return followingSet.has(pubkey)
|
|
|
|
return userId ? followingSet.has(Pubkey.tryFromString(userId)?.hex ?? userId) : false
|
|
}, [followingSet, pubkey, userId])
|
|
|
|
if (!isFollowing) return null
|
|
|
|
return (
|
|
<div className="rounded-full bg-muted px-2 py-0.5 flex items-center" title={t('Following')}>
|
|
<UserRoundCheck className="!size-3" />
|
|
</div>
|
|
)
|
|
}
|