Michael Novotny b0719494a2
Only create cart / cookie when needed (#1078)
* Only create cart / cookie when needed

* Fixes lint
2023-07-14 15:21:54 -07:00

15 lines
307 B
TypeScript

import { getCart } from 'lib/shopify';
import { cookies } from 'next/headers';
import CartModal from './modal';
export default async function Cart() {
const cartId = cookies().get('cartId')?.value;
let cart;
if (cartId) {
cart = await getCart(cartId);
}
return <CartModal cart={cart} />;
}