Files
smesh/src/components/ProfileCard/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

43 lines
1.4 KiB
TypeScript

import { Pubkey } from '@/domain'
import { useFetchProfile } from '@/hooks'
import { useMemo } from 'react'
import FollowButton from '../FollowButton'
import Nip05 from '../Nip05'
import ProfileAbout from '../ProfileAbout'
import TextWithEmojis from '../TextWithEmojis'
import TrustScoreBadge from '../TrustScoreBadge'
import { SimpleUserAvatar } from '../UserAvatar'
export default function ProfileCard({ userId }: { userId: string }) {
const pubkey = useMemo(() => Pubkey.tryFromString(userId)?.hex ?? userId, [userId])
const { profile } = useFetchProfile(userId)
const { username, about, emojis } = profile || {}
return (
<div className="w-full flex flex-col gap-2 not-prose">
<div className="flex space-x-2 w-full items-start justify-between">
<SimpleUserAvatar userId={pubkey} className="w-12 h-12" />
<FollowButton pubkey={pubkey} />
</div>
<div>
<div className="flex gap-2 items-center">
<TextWithEmojis
text={username || ''}
emojis={emojis}
className="text-lg font-semibold truncate"
/>
<TrustScoreBadge pubkey={pubkey} />
</div>
<Nip05 pubkey={pubkey} />
</div>
{about && (
<ProfileAbout
about={about}
emojis={emojis}
className="text-sm text-wrap break-words w-full overflow-hidden text-ellipsis line-clamp-6"
/>
)}
</div>
)
}