feat(ui): resolve nprofile strings to human-readable names

- Add extractNprofilePubkeys utility to parse nprofile strings from content
- Create ContentWithResolvedProfiles component using applesauce ProfileModel
- Replace nprofile strings with @displayName in bookmark content
- Update BookmarkItem to use resolved content rendering
- Improves readability by showing names instead of long nprofile strings
This commit is contained in:
Gigi
2025-10-03 00:02:22 +02:00
parent 0bae6674ce
commit 6d585dcef6
2 changed files with 69 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ import {
import { useEventModel } from 'applesauce-react/hooks'
import { Models } from 'applesauce-core'
import { IndividualBookmark } from '../types/bookmarks'
import { formatDate, renderParsedContent } from '../utils/bookmarkUtils'
import { formatDate, renderParsedContent, ContentWithResolvedProfiles } from '../utils/bookmarkUtils'
import { extractUrlsFromContent } from '../services/bookmarkHelpers'
interface BookmarkItemProps {
@@ -142,9 +142,7 @@ export const BookmarkItem: React.FC<BookmarkItemProps> = ({ bookmark, index, onS
{renderParsedContent(bookmark.parsedContent)}
</div>
) : bookmark.content && (
<div className="bookmark-content">
<p>{bookmark.content}</p>
</div>
<ContentWithResolvedProfiles content={bookmark.content} />
)}
<div className="bookmark-meta">