| 1234567891011121314151617181920212223242526272829303132 |
- import { NextPage } from 'next';
- import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
- import nookies from 'nookies';
- import CheckoutContent from '../../components/checkout-content/CheckoutContent';
-
- const CheckoutPage: NextPage = () => {
- return <CheckoutContent></CheckoutContent>;
- };
-
- export const getServerSideProps = async (ctx: any) => {
- const cookies = nookies.get(ctx);
-
- if (!cookies['checkout-session']) {
- return {
- redirect: {
- destination: '/cart',
- permanent: false,
- },
- };
- }
-
- return {
- props: {
- ...(await serverSideTranslations(ctx.locale, [
- 'checkout',
- 'addressForm',
- ])),
- },
- };
- };
-
- export default CheckoutPage;
|