import type { GetStaticPropsContext } from 'next' import getAllPages from '@lib/bigcommerce/api/operations/get-all-pages' import { Layout } from '@components/core' import { Button } from '@components/ui' import { Bag, Cross, Check } from '@components/icons' import useCart from '@lib/bigcommerce/cart/use-cart' import usePrice from '@lib/bigcommerce/use-price' import { CartItem } from '@components/cart' import { Text } from '@components/ui' export async function getStaticProps({ preview }: GetStaticPropsContext) { const { pages } = await getAllPages({ preview }) return { props: { pages }, } } export default function Cart() { const { data, isEmpty } = useCart() const { price: subTotal } = usePrice( data && { amount: data.base_amount, currencyCode: data.currency.code, } ) const { price: total } = usePrice( data && { amount: data.cart_amount, currencyCode: data.currency.code, } ) const items = data?.line_items.physical_items ?? [] const error = null const success = null return (
{isEmpty ? (

Your cart is empty

Biscuit oat cake wafer icing ice cream tiramisu pudding cupcake.

) : error ? (

We couldn’t process the purchase. Please check your card information and try again.

) : success ? (

Thank you for your order.

) : (
My Cart 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}
) } Cart.Layout = Layout