From c0aa6d5e7339e27d159a9ab4da0965fb4c05df39 Mon Sep 17 00:00:00 2001
From: Cari <44416326+lilacpixel@users.noreply.github.com>
Date: Thu, 16 May 2024 17:56:37 -0400
Subject: feature(web): Clicking an image in the preview modal will open it in
 a new tab (#159)

---
 .../dashboard/preview/AssetContentSection.tsx          | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

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

diff --git a/apps/web/components/dashboard/preview/AssetContentSection.tsx b/apps/web/components/dashboard/preview/AssetContentSection.tsx
index 94bd16ce..4d6bb976 100644
--- a/apps/web/components/dashboard/preview/AssetContentSection.tsx
+++ b/apps/web/components/dashboard/preview/AssetContentSection.tsx
@@ -1,4 +1,5 @@
 import Image from "next/image";
+import Link from "next/link";
 
 import type { ZBookmark } from "@hoarder/shared/types/bookmarks";
 
@@ -11,12 +12,17 @@ export function AssetContentSection({ bookmark }: { bookmark: ZBookmark }) {
     case "image": {
       return (
         <div className="relative h-full min-w-full">
-          <Image
-            alt="asset"
-            fill={true}
-            className="object-contain"
-            src={`/api/assets/${bookmark.content.assetId}`}
-          />
+          <Link
+            href={`/api/assets/${bookmark.content.assetId}`}
+            target="_blank"
+          >
+            <Image
+              alt="asset"
+              fill={true}
+              className="object-contain"
+              src={`/api/assets/${bookmark.content.assetId}`}
+            />
+          </Link>
         </div>
       );
     }
-- 
cgit v1.2.3-70-g09d2

