From d6dd76021226802adf5295b3243d6f2ae4fa5cc2 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sun, 10 Mar 2024 17:59:58 +0000 Subject: refactor: Move all components to the top level directory --- .../dashboard/lists/components/AllListsView.tsx | 66 ---------------------- 1 file changed, 66 deletions(-) delete mode 100644 packages/web/app/dashboard/lists/components/AllListsView.tsx (limited to 'packages/web/app/dashboard/lists/components') diff --git a/packages/web/app/dashboard/lists/components/AllListsView.tsx b/packages/web/app/dashboard/lists/components/AllListsView.tsx deleted file mode 100644 index 0e2f898b..00000000 --- a/packages/web/app/dashboard/lists/components/AllListsView.tsx +++ /dev/null @@ -1,66 +0,0 @@ -"use client"; - -import { Button } from "@/components/ui/button"; -import { api } from "@/lib/trpc"; -import { ZBookmarkList } from "@hoarder/trpc/types/lists"; -import { keepPreviousData } from "@tanstack/react-query"; -import { Plus } from "lucide-react"; -import Link from "next/link"; -import { useNewListModal } from "../../components/NewListModal"; - -function ListItem({ - name, - icon, - path, -}: { - name: string; - icon: string; - path: string; -}) { - return ( - -
-

- {icon} {name} -

-
- - ); -} - -export default function AllListsView({ - initialData, -}: { - initialData: ZBookmarkList[]; -}) { - const { setOpen: setIsNewListModalOpen } = useNewListModal(); - let { data: lists } = api.lists.list.useQuery(undefined, { - initialData: { lists: initialData }, - placeholderData: keepPreviousData, - }); - - // TODO: This seems to be a bug in react query - lists ||= { lists: initialData }; - - return ( -
- - - - {lists.lists.map((l) => ( - - ))} -
- ); -} -- cgit v1.2.3-70-g09d2