import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faChevronLeft, faChevronRight } from '@fortawesome/free-solid-svg-icons' import { Bookmark } from '../types/bookmarks' import { BookmarkItem } from './BookmarkItem' import { formatDate, renderParsedContent } from '../utils/bookmarkUtils' interface BookmarkListProps { bookmarks: Bookmark[] onSelectUrl?: (url: string) => void isCollapsed: boolean onToggleCollapse: () => void } export const BookmarkList: React.FC = ({ bookmarks, onSelectUrl, isCollapsed, onToggleCollapse }) => { if (isCollapsed) { return (
) } return (
{bookmarks.length === 0 ? (

No bookmarks found.

Add bookmarks using your nostr client to see them here.

) : (
{bookmarks.map((bookmark, index) => (
{bookmark.bookmarkCount && (

{bookmark.bookmarkCount} bookmarks in{' '} this list :

)} {bookmark.urlReferences && bookmark.urlReferences.length > 0 && (

URLs:

{bookmark.urlReferences.map((url, index) => ( {url} ))}
)} {bookmark.individualBookmarks && bookmark.individualBookmarks.length > 0 && (
{bookmark.individualBookmarks.map((individualBookmark, index) => )}
)} {bookmark.eventReferences && bookmark.eventReferences.length > 0 && bookmark.individualBookmarks?.length === 0 && (

Event References ({bookmark.eventReferences.length}):

{bookmark.eventReferences.slice(0, 3).map((eventId, index) => ( {eventId.slice(0, 8)}...{eventId.slice(-8)} ))} {bookmark.eventReferences.length > 3 && ( ... and {bookmark.eventReferences.length - 3} more )}
)} {bookmark.parsedContent ? (
{renderParsedContent(bookmark.parsedContent)}
) : bookmark.content && (

{bookmark.content}

)}
Created: {formatDate(bookmark.created_at)}
))}
)}
) }