Skip to content

Commit 0e7cf96

Browse files
committed
fix: use cart from context in cart view
1 parent bf7fe28 commit 0e7cf96

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/sections/Cart/Cart.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
"use client"
2+
13
import { Button } from "@/components/atoms"
24
import { CartEmpty, CartItems, CartSummary } from "@/components/organisms"
35
import LocalizedClientLink from "@/components/molecules/LocalizedLink/LocalizedLink"
4-
import { retrieveCart } from "@/lib/data/cart"
56
import CartPromotionCode from "../CartReview/CartPromotionCode"
6-
import { EmptyCart } from "@/components/organisms/CartItems/EmptyCart"
7-
8-
export const Cart = async () => {
9-
const cart = await retrieveCart()
7+
import { useCartContext } from "@/components/providers"
108

9+
export const Cart = () => {
10+
const { cart } = useCartContext()
11+
1112
if (!cart || !cart.items?.length) {
1213
return <CartEmpty />
1314
}

0 commit comments

Comments
 (0)