mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 05:56:59 +00:00
15 lines
399 B
TypeScript
15 lines
399 B
TypeScript
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;
|
|
let cartIdUpdated = true;
|
|
const cart = await getCart();
|
|
|
|
if (cartId !== cart.id) {
|
|
cartIdUpdated = true;
|
|
}
|
|
return <CartModal cart={cart} cartIdUpdated={cartIdUpdated} />;
|
|
}
|