From f99e0aba70efad0deb907d8e27f09fc9f527c8a4 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Fri, 17 Feb 2023 17:07:50 +0700
Subject: Refactor

---
 src/lib/cart/components/Cart.jsx | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 src/lib/cart/components/Cart.jsx

(limited to 'src/lib/cart/components/Cart.jsx')

diff --git a/src/lib/cart/components/Cart.jsx b/src/lib/cart/components/Cart.jsx
new file mode 100644
index 00000000..5f9ae1c0
--- /dev/null
+++ b/src/lib/cart/components/Cart.jsx
@@ -0,0 +1,30 @@
+import Link from "@/core/components/elements/Link/Link"
+import useCart from "../hooks/useCart"
+import Image from "@/core/components/elements/Image/Image"
+
+const Cart = () => {
+  const { cart } = useCart()
+  
+  return (
+    <div className="p-4">
+      <div className="flex justify-between mb-4">
+        <h1 className="font-semibold">Daftar Produk Belanja</h1>
+        <Link href="/">Cari Produk Lain</Link>
+      </div>
+      <div className="flex flex-col gap-y-4">
+        { cart.data?.map((product) => (
+          <div key={product.id} className="flex">
+            <div className="w-4/12">
+              <Image src={product?.parent?.image} alt={product?.name} className="object-contain object-center border border-gray_r-6 h-32 w-full rounded-md" />
+            </div>
+            <div className="flex-1 px-2">
+              <div>{ product?.parent?.name }</div>
+            </div>
+          </div>
+        )) }
+      </div>
+    </div>
+  )
+}
+
+export default Cart
\ No newline at end of file
-- 
cgit v1.2.3

