diff --git a/src/components/BookmarkItem.tsx b/src/components/BookmarkItem.tsx index 6f400910..1824a2b3 100644 --- a/src/components/BookmarkItem.tsx +++ b/src/components/BookmarkItem.tsx @@ -1,6 +1,27 @@ import React from 'react' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faBookmark, faUserLock, faCopy } from '@fortawesome/free-solid-svg-icons' +import { + faBookmark, + faUserLock, + faCopy, + faCircleUser, + faFeather, + faRetweet, + faHeart, + faImage, + faVideo, + faFile, + faLaptopCode, + faCodePullRequest, + faBug, + faExclamationTriangle, + faBolt, + faCloudBolt, + faHighlighter, + faNewspaper, + faEyeSlash, + faThumbtack +} from '@fortawesome/free-solid-svg-icons' import { IndividualBookmark } from '../types/bookmarks' import { formatDate, renderParsedContent } from '../utils/bookmarkUtils' import { extractUrlsFromContent } from '../services/bookmarkHelpers' @@ -26,6 +47,32 @@ export const BookmarkItem: React.FC = ({ bookmark, index, onS const extractedUrls = extractUrlsFromContent(bookmark.content) const hasUrls = extractedUrls.length > 0 + // Map kind numbers to FontAwesome icons + const getKindIcon = (kind: number) => { + const iconMap: Record = { + 0: faCircleUser, + 1: faFeather, + 6: faRetweet, + 7: faHeart, + 20: faImage, + 21: faVideo, + 22: faVideo, + 1063: faFile, + 1337: faLaptopCode, + 1617: faCodePullRequest, + 1621: faBug, + 1984: faExclamationTriangle, + 9735: faBolt, + 9321: faCloudBolt, + 9802: faHighlighter, + 30023: faNewspaper, + 10000: faEyeSlash, + 10001: faThumbtack, + 10003: faBookmark + } + return iconMap[kind] || faFile // fallback to file icon + } + const handleReadNow = (event: React.MouseEvent) => { if (!hasUrls) return const firstUrl = extractedUrls[0] @@ -88,7 +135,9 @@ export const BookmarkItem: React.FC = ({ bookmark, index, onS )}
- Kind: {bookmark.kind} + + + Author: {short(bookmark.pubkey)}