|
- import React from 'react';
- import Navbar from "@/components/_App/NavbarYamaha";
- import Footer from "@/components/_App/FooterYamaha";
- import PageBanner from '@/components/Common/PageBanner';
- import CheckoutContent from '@/components/Yamaha/Shop/Checkout';
- import * as Icon from 'react-feather';
-
- import CheckoutProduct from "api/shop/checkout";
-
- const Checkout = function ({ backend, checkout_product, ...props }) {
- return (
- <>
- <Navbar />
-
- <PageBanner pageTitle="Checkout" />
-
- <CheckoutContent checkout_product={checkout_product} backend={backend} />
-
- <Footer />
- </>
- )
- }
-
- export default Checkout;
-
- export async function getServerSideProps() {
- var checkout_product = [];
- const backend = process.env.BACKEND_SERVER_URI;
-
- var res = await CheckoutProduct.GetCheckoutproduct();
- if (res["STATUS"] === 1) {
- checkout_product = res["DATA"]["checkouts"];
- }
-
- console.log(checkout_product);
- return {
- props: { checkout_product, backend }, // will be passed to the page component as props
- };
- }
|