2024-07-20 15:15:23 -07:00

16 lines
398 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: Store }) {
const cartId = cookies().get('cartId')?.value;
let cart;
if (cartId) {
cart = await getCart(store, cartId);
}
return <CartModal cart={cart} store={store} />;
}