From 4fae8f04f546d2b3f6053870d93385fa36af4742 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Fri, 9 Feb 2024 15:32:04 +0000
Subject: [ui] Adding the favourites and archive pages

---
 .../app/dashboard/bookmarks/components/BookmarksGrid.tsx | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)

(limited to 'packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx')

diff --git a/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx b/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx
index f52ef910..11845ca3 100644
--- a/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx
+++ b/packages/web/app/dashboard/bookmarks/components/BookmarksGrid.tsx
@@ -1,7 +1,3 @@
-import { getServerSession } from "next-auth";
-import { redirect } from "next/navigation";
-import { authOptions } from "@/lib/auth";
-import { getBookmarks } from "@/lib/services/bookmarks";
 import LinkCard from "./LinkCard";
 import { ZBookmark } from "@/lib/types/api/bookmarks";
 
@@ -12,13 +8,11 @@ function renderBookmark(bookmark: ZBookmark) {
   }
 }
 
-export default async function BookmarksGrid() {
-  const session = await getServerSession(authOptions);
-  if (!session) {
-    redirect("/");
-  }
-  const bookmarks = await getBookmarks(session.user.id);
-
+export default function BookmarksGrid({
+  bookmarks,
+}: {
+  bookmarks: ZBookmark[];
+}) {
   return (
     <div className="container grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
       {bookmarks.map((b) => renderBookmark(b))}
-- 
cgit v1.2.3-70-g09d2

