From 081bd95f605a0f288a14c7543cddb7427030a04f Mon Sep 17 00:00:00 2001 From: Gigi Date: Wed, 15 Oct 2025 14:22:13 +0200 Subject: [PATCH] feat(bookmarks): classify web bookmark URLs to show appropriate content icons --- src/components/BookmarkItem.tsx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/components/BookmarkItem.tsx b/src/components/BookmarkItem.tsx index 72d9e6f2..0a2363f0 100644 --- a/src/components/BookmarkItem.tsx +++ b/src/components/BookmarkItem.tsx @@ -71,7 +71,22 @@ export const BookmarkItem: React.FC = ({ bookmark, index, onS // Get content type icon based on bookmark kind and URL classification const getContentTypeIcon = (): IconDefinition => { if (isArticle) return faNewspaper - if (isWebBookmark) return faGlobe + + // For web bookmarks, classify the URL to determine icon + if (isWebBookmark && firstUrlClassification) { + switch (firstUrlClassification.type) { + case 'youtube': + case 'video': + return faPlay + case 'image': + return faEye + case 'article': + return faNewspaper + default: + return faGlobe + } + } + if (!hasUrls) return faStickyNote // Just a text note if (firstUrlClassification?.type === 'youtube' || firstUrlClassification?.type === 'video') return faPlay return faBookOpen