import Link from 'next/link' import { FC } from 'react' import CartItem from '@components/cart/CartItem' import { Button, Text } from '@components/ui' import { useUI } from '@components/ui/context' import SidebarLayout from '@components/common/SidebarLayout' // import useCart from '@framework/cart/use-cart' // import usePrice from '@framework/product/use-price' // import useCheckout from '@framework/checkout/use-checkout' import ShippingWidget from '../ShippingWidget' import PaymentWidget from '../PaymentWidget' import s from './CheckoutSidebarView.module.css' const CheckoutSidebarView: FC = () => { const { setSidebarView, closeSidebar } = useUI() // const { data: cartData } = useCart() // const { data: checkoutData, submit: onCheckout } = useCheckout() // async function handleSubmit(event: React.ChangeEvent) { // event.preventDefault() // await onCheckout() // closeSidebar() // } // const { price: subTotal } = usePrice( // cartData && { // amount: Number(cartData.subtotalPrice), // currencyCode: cartData.currency.code, // } // ) // const { price: total } = usePrice( // cartData && { // amount: Number(cartData.totalPrice), // currencyCode: cartData.currency.code, // } // ) return ( setSidebarView('CART_VIEW')} >
Checkout {/* setSidebarView('PAYMENT_VIEW')} /> setSidebarView('SHIPPING_VIEW')} /> */}
    {/* {cartData!.lineItems.map((item: any) => ( ))} */}
  • Subtotal {/* {subTotal} */}
  • Taxes Calculated at checkout
  • Shipping FREE
Total {/* {total} */}
{/* Once data is correcly filled */}
) } export default CheckoutSidebarView