From 04572a8e5081b1e4871e273cde9dbaaa44c52fe0 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Wed, 13 Mar 2024 21:43:44 +0000
Subject: structure: Create apps dir and copy tooling dir from t3-turbo repo

---
 .../dashboard/bookmarks/BookmarksGrid.tsx          | 64 ----------------------
 1 file changed, 64 deletions(-)
 delete mode 100644 packages/web/components/dashboard/bookmarks/BookmarksGrid.tsx

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

diff --git a/packages/web/components/dashboard/bookmarks/BookmarksGrid.tsx b/packages/web/components/dashboard/bookmarks/BookmarksGrid.tsx
deleted file mode 100644
index 4d5b6b0a..00000000
--- a/packages/web/components/dashboard/bookmarks/BookmarksGrid.tsx
+++ /dev/null
@@ -1,64 +0,0 @@
-"use client";
-
-import LinkCard from "./LinkCard";
-import { ZBookmark, ZGetBookmarksRequest } from "@hoarder/trpc/types/bookmarks";
-import { api } from "@/lib/trpc";
-import TextCard from "./TextCard";
-import { Slot } from "@radix-ui/react-slot";
-import Masonry from "react-masonry-css";
-import resolveConfig from "tailwindcss/resolveConfig";
-import tailwindConfig from "@/tailwind.config";
-import { useMemo } from "react";
-
-function getBreakpointConfig() {
-  const fullConfig = resolveConfig(tailwindConfig);
-
-  const breakpointColumnsObj: { [key: number]: number; default: number } = {
-    default: 3,
-  };
-  breakpointColumnsObj[parseInt(fullConfig.theme.screens.lg)] = 2;
-  breakpointColumnsObj[parseInt(fullConfig.theme.screens.md)] = 1;
-  breakpointColumnsObj[parseInt(fullConfig.theme.screens.sm)] = 1;
-  return breakpointColumnsObj;
-}
-
-function renderBookmark(bookmark: ZBookmark) {
-  let comp;
-  switch (bookmark.content.type) {
-    case "link":
-      comp = <LinkCard bookmark={bookmark} />;
-      break;
-    case "text":
-      comp = <TextCard bookmark={bookmark} />;
-      break;
-  }
-  return (
-    <Slot
-      key={bookmark.id}
-      className="border-grey-100 mb-4 border bg-gray-50 duration-300 ease-in hover:border-blue-300 hover:transition-all"
-    >
-      {comp}
-    </Slot>
-  );
-}
-
-export default function BookmarksGrid({
-  query,
-  bookmarks: initialBookmarks,
-}: {
-  query: ZGetBookmarksRequest;
-  bookmarks: ZBookmark[];
-}) {
-  const { data } = api.bookmarks.getBookmarks.useQuery(query, {
-    initialData: { bookmarks: initialBookmarks },
-  });
-  const breakpointConfig = useMemo(() => getBreakpointConfig(), []);
-  if (data.bookmarks.length == 0) {
-    return <p>No bookmarks</p>;
-  }
-  return (
-    <Masonry className="flex gap-4" breakpointCols={breakpointConfig}>
-      {data.bookmarks.map((b) => renderBookmark(b))}
-    </Masonry>
-  );
-}
-- 
cgit v1.2.3-70-g09d2

