From 5933732a74ae1ca4124ddd4e8265b1f443234736 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Tue, 21 Feb 2023 21:51:51 +0700 Subject: fix --- src/lib/wishlist/components/Wishlists.jsx | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/lib/wishlist/components/Wishlists.jsx (limited to 'src/lib/wishlist/components') diff --git a/src/lib/wishlist/components/Wishlists.jsx b/src/lib/wishlist/components/Wishlists.jsx new file mode 100644 index 00000000..8a456a8d --- /dev/null +++ b/src/lib/wishlist/components/Wishlists.jsx @@ -0,0 +1,41 @@ +import Alert from "@/core/components/elements/Alert/Alert" +import Pagination from "@/core/components/elements/Pagination/Pagination" +import Spinner from "@/core/components/elements/Spinner/Spinner" +import ProductCard from "@/lib/product/components/ProductCard" +import { useRouter } from "next/router" +import useWishlists from "../hooks/useWishlists" + +const Wishlists = () => { + const router = useRouter() + const { + page = 1 + } = router.query + const limit = 30 + const { wishlists } = useWishlists({ page, limit }) + + const pageCount = Math.ceil(wishlists.data?.productTotal / limit) + + return ( +
+ { wishlists.isLoading && ( + + ) } + { wishlists.data?.products?.length == 0 && ( + + Wishlist anda masih kosong + + ) } +
+ {wishlists.data?.products.map((product) => ( + + ))} +
+ +
+ +
+
+ ) +} + +export default Wishlists \ No newline at end of file -- cgit v1.2.3