mirror of
https://github.com/vercel/commerce.git
synced 2025-07-29 21:21:23 +00:00
.github
.vscode
@
app
components
cart
actions.ts
add-to-cart.tsx
close-cart.tsx
delete-item-button.tsx
edit-item-quantity-button.tsx
index.tsx
modal.tsx
open-cart.tsx
grid
icons
layout
product
store
ui
opengraph-image.tsx
constants
fonts
lib
public
.env.example
.eslintrc.js
.gitignore
.nvmrc
.prettierignore
README.md
components.json
license.md
next.config.js
package.json
pnpm-lock.yaml
postcss.config.js
prettier.config.js
tailwind.config.js
tsconfig.json
15 lines
307 B
TypeScript
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} />;
|
|
}
|