From 994691b02515dfb579a5c3618631065bd76b9e4b Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Sun, 7 Apr 2024 19:02:52 +0100
Subject: refactor(web): Move the tooltip provider to the root of the app

---
 .../dashboard/preview/BookmarkPreview.tsx          | 45 ++++++++++------------
 1 file changed, 20 insertions(+), 25 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 bd7881a3..cf8bc2d8 100644
--- a/apps/web/components/dashboard/preview/BookmarkPreview.tsx
+++ b/apps/web/components/dashboard/preview/BookmarkPreview.tsx
@@ -8,7 +8,6 @@ import {
   Tooltip,
   TooltipContent,
   TooltipPortal,
-  TooltipProvider,
   TooltipTrigger,
 } from "@/components/ui/tooltip";
 import {
@@ -41,18 +40,16 @@ function ContentLoading() {
 
 function CreationTime({ createdAt }: { createdAt: Date }) {
   return (
-    <TooltipProvider>
-      <Tooltip delayDuration={0}>
-        <TooltipTrigger asChild>
-          <span className="flex w-fit gap-2">
-            <CalendarDays /> {dayjs(createdAt).fromNow()}
-          </span>
-        </TooltipTrigger>
-        <TooltipPortal>
-          <TooltipContent>{createdAt.toLocaleString()}</TooltipContent>
-        </TooltipPortal>
-      </Tooltip>
-    </TooltipProvider>
+    <Tooltip delayDuration={0}>
+      <TooltipTrigger asChild>
+        <span className="flex w-fit gap-2">
+          <CalendarDays /> {dayjs(createdAt).fromNow()}
+        </span>
+      </TooltipTrigger>
+      <TooltipPortal>
+        <TooltipContent>{createdAt.toLocaleString()}</TooltipContent>
+      </TooltipPortal>
+    </Tooltip>
   );
 }
 
@@ -65,18 +62,16 @@ function LinkHeader({ bookmark }: { bookmark: ZBookmark }) {
 
   return (
     <div className="flex w-full flex-col items-center justify-center space-y-3">
-      <TooltipProvider>
-        <Tooltip>
-          <TooltipTrigger asChild>
-            <p className="line-clamp-2 text-center text-lg">{title}</p>
-          </TooltipTrigger>
-          <TooltipPortal>
-            <TooltipContent side="bottom" className="w-96">
-              {title}
-            </TooltipContent>
-          </TooltipPortal>
-        </Tooltip>
-      </TooltipProvider>
+      <Tooltip>
+        <TooltipTrigger asChild>
+          <p className="line-clamp-2 text-center text-lg">{title}</p>
+        </TooltipTrigger>
+        <TooltipPortal>
+          <TooltipContent side="bottom" className="w-96">
+            {title}
+          </TooltipContent>
+        </TooltipPortal>
+      </Tooltip>
       <Link
         href={bookmark.content.url}
         className="mx-auto flex gap-2 text-gray-400"
-- 
cgit v1.2.3-70-g09d2

