import type { NextPage } from 'next';
import dynamic from 'next/dynamic';

import StrapiSeo from '@/components/common/seo/StrapiSeo';
import { fetchSingleTypePageData } from '@/helpers/utilities/fetchAPI';
const ECommerceWebsiteDevelopment = dynamic(
    () => import('@/components/serviceDetails/eCommerceWebsiteDevelopment/ECommerceWebsiteDevelopment'),
);

const populateFields = [
    'seo.ogImage',
    'seo.multiStructureData',
    'hero.bottomImages',
    'hero.buttonIcon',
    'leftRightCom.card.image',
    'leftRightCom.card.icon',
    'developmentService.service.logo',
    'processData',
    'upscale.service.logo',
    'developmentService.service.logo',
    'brandLogos.brands.logo',
    'caseStudies.cardImage',
    'basePoke.service.logo',
    'inclusive.tabs.icon',
    'inclusive.tabs.bigImage',
    'vetted.chooseCard.image',
    'forwardThink.service.logo',
    'chooseUs.content.image',
    'faq.FAQ.icon',
    'clients.brandLogos.brands.logo',
];

export async function getStaticProps() {
    return await fetchSingleTypePageData(populateFields, 'e-commerce-page');
}

const ECommerceWebsiteDevelopmentPage: NextPage = ({ data }: any) => {
    return (
        <>
            <StrapiSeo content={data.data?.attributes?.seo} />
            <ECommerceWebsiteDevelopment data={data.data?.attributes} />
        </>
    );
};

export default ECommerceWebsiteDevelopmentPage;
