From b147c8e5df75bdeafb1f0eeb2e6ce08e0dec7e37 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sat, 5 Oct 2024 18:16:19 +0000
Subject: feature: Persevere the source URL of clipped texts from the
 extension. Fixes #448

---
 apps/web/components/dashboard/preview/BookmarkPreview.tsx | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

(limited to 'apps/web/components/dashboard/preview/BookmarkPreview.tsx')

diff --git a/apps/web/components/dashboard/preview/BookmarkPreview.tsx b/apps/web/components/dashboard/preview/BookmarkPreview.tsx
index 1f099725..5e2764f4 100644
--- a/apps/web/components/dashboard/preview/BookmarkPreview.tsx
+++ b/apps/web/components/dashboard/preview/BookmarkPreview.tsx
@@ -18,6 +18,7 @@ import relativeTime from "dayjs/plugin/relativeTime";
 import { CalendarDays, ExternalLink } from "lucide-react";
 
 import {
+  getSourceUrl,
   isBookmarkStillCrawling,
   isBookmarkStillLoading,
 } from "@hoarder/shared-react/utils/bookmarkUtils";
@@ -66,16 +67,6 @@ function CreationTime({ createdAt }: { createdAt: Date }) {
   );
 }
 
-function getSourceUrl(bookmark: ZBookmark) {
-  if (bookmark.content.type === BookmarkTypes.LINK) {
-    return bookmark.content.url;
-  }
-  if (bookmark.content.type === BookmarkTypes.ASSET) {
-    return bookmark.content.sourceUrl;
-  }
-  return null;
-}
-
 export default function BookmarkPreview({
   bookmarkId,
   initialData,
-- 
cgit v1.2.3-70-g09d2

