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