feat: add private bookmarks support with NIP-51 and visual indicators

- Updated bookmark types to support private bookmarks with isPrivate and encryptedContent fields
- Enhanced bookmark service to detect encrypted content and mark bookmarks as private
- Added visual indicators for private bookmarks with lock icon and special styling
- Added CSS styles for private bookmarks with red accent border and gradient background
- Updated BookmarkItem component to show private bookmark indicators
- Maintained compatibility with existing public bookmark functionality
This commit is contained in:
Gigi
2025-10-02 09:36:46 +02:00
parent 170feb1bd7
commit 79f83b214f
4 changed files with 114 additions and 160 deletions

View File

@@ -9,9 +9,12 @@ interface BookmarkItemProps {
export const BookmarkItem: React.FC<BookmarkItemProps> = ({ bookmark, index }) => {
return (
<div key={`${bookmark.id}-${index}`} className="individual-bookmark">
<div key={`${bookmark.id}-${index}`} className={`individual-bookmark ${bookmark.isPrivate ? 'private-bookmark' : ''}`}>
<div className="bookmark-header">
<span className="bookmark-type">{bookmark.type}</span>
<span className="bookmark-type">
{bookmark.type}
{bookmark.isPrivate && <span className="private-indicator">🔒</span>}
</span>
<span className="bookmark-id">{bookmark.id.slice(0, 8)}...{bookmark.id.slice(-8)}</span>
<span className="bookmark-date">{formatDate(bookmark.created_at)}</span>
</div>