mirror of
https://github.com/vercel/commerce.git
synced 2025-05-09 03:07:50 +00:00
16 lines
397 B
TypeScript
16 lines
397 B
TypeScript
import { Store } from 'lib/aspire/types';
|
|
import { getCart } from 'lib/shopify';
|
|
import { cookies } from 'next/headers';
|
|
import CartModal from './modal';
|
|
|
|
export default async function Cart({ store }: { store: Store }) {
|
|
const cartId = cookies().get('cartId')?.value;
|
|
let cart;
|
|
|
|
if (cartId) {
|
|
cart = await getCart(store, cartId);
|
|
}
|
|
|
|
return <CartModal cart={cart} store={store} />;
|
|
}
|