import type { GetStaticPropsContext } from 'next' import { getConfig } from '@bigcommerce/storefront-data-hooks/api' import getAllPages from '@bigcommerce/storefront-data-hooks/api/operations/get-all-pages' import { useCart } from '@lib/hooks/use-cart' import { Layout } from '@components/core' import { Button } from '@components/ui' import { Bag, Cross, Check } from '@components/icons' import { CartItem } from '@components/cart' import { Text } from '@components/ui' export async function getStaticProps({ preview, locale, }: GetStaticPropsContext) { const config = getConfig({ locale }) const { pages } = await getAllPages({ config, preview }) return { props: { pages }, } } export default function Cart() { const { items, isLoading, isError, isEmpty, subtotal, total, currency, } = useCart() return (
My Cart {isError &&
Failed to load
} {isLoading &&
Loading...
} {isEmpty ? (

Your cart is empty

Biscuit oat cake wafer icing ice cream tiramisu pudding cupcake.

) : (
Review your Order
    {items.map((item) => ( ))}
Before you leave, take a look at these items. We picked them just for you:
{[1, 2, 3, 4, 5, 6].map((x) => (
))}
  • Subtotal {subtotal}
  • Taxes Calculated at checkout
  • Estimated Shipping FREE
Total {total}
{isEmpty ? ( ) : ( )}
)}
) } Cart.Layout = Layout