Files
smesh/src/components/FollowingBadge/index.tsx
woikos 4c3e8d5cc7 Release v0.3.1
- 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>
2026-01-04 07:29:07 +01:00

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>
)
}