aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components/dashboard/bookmarks/FooterLinkURL.tsx
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/bookmarks/FooterLinkURL.tsx
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/bookmarks/FooterLinkURL.tsx')
-rw-r--r--apps/web/components/dashboard/bookmarks/FooterLinkURL.tsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/bookmarks/FooterLinkURL.tsx b/apps/web/components/dashboard/bookmarks/FooterLinkURL.tsx
new file mode 100644
index 00000000..cc91a7e7
--- /dev/null
+++ b/apps/web/components/dashboard/bookmarks/FooterLinkURL.tsx
@@ -0,0 +1,18 @@
+import Link from "next/link";
+
+export default function FooterLinkURL({ url }: { url: string | null }) {
+ if (!url) {
+ return null;
+ }
+ const parsedUrl = new URL(url);
+ return (
+ <Link
+ className="line-clamp-1 hover:text-foreground"
+ href={url}
+ target="_blank"
+ rel="noreferrer"
+ >
+ {parsedUrl.host}
+ </Link>
+ );
+}