aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/preview
diff options
context:
space:
mode:
authorMohamedBassem <me@mbassem.com>2024-10-05 18:16:19 +0000
committerMohamedBassem <me@mbassem.com>2024-10-05 18:16:46 +0000
commitb147c8e5df75bdeafb1f0eeb2e6ce08e0dec7e37 (patch)
tree1bfae4f49f8aeaf3870573831fdb62921ec38dd4 /apps/web/components/dashboard/preview
parentf1c956a361539592d00836488181b69218798600 (diff)
downloadkarakeep-b147c8e5df75bdeafb1f0eeb2e6ce08e0dec7e37.tar.zst
feature: Persevere the source URL of clipped texts from the extension.
Fixes #448
Diffstat (limited to 'apps/web/components/dashboard/preview')
-rw-r--r--apps/web/components/dashboard/preview/BookmarkPreview.tsx11
1 files changed, 1 insertions, 10 deletions
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,