mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 22:16:58 +00:00
16 lines
485 B
TypeScript
16 lines
485 B
TypeScript
import { fetchCart } from 'components/cart/actions';
|
|
import { getCart } from 'lib/shopware';
|
|
import { cookies } from 'next/headers';
|
|
import CartModal from './modal';
|
|
|
|
export default async function Cart() {
|
|
const cartId = cookies().get('sw-context-token')?.value;
|
|
await fetchCart(cartId);
|
|
let cartIdUpdated = false;
|
|
const cart = await getCart(cartId);
|
|
|
|
if (cartId !== cart.id) {
|
|
cartIdUpdated = true;
|
|
}
|
|
return <CartModal cart={cart} cartIdUpdated={cartIdUpdated} />;
|
|
} |