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

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

const populateFields = [
    'seo.ogImage',
    'seo.multiStructureData',
    'hero.bottomImages',
    'hero.buttonIcon',
    'leftRightCom.card.image',
    'leftRightCom.card.icon',
    'businessNeed.card.icon',
    'brandLogo.logo',
    'whyUs.cardContent.icon',
    'optimizeService.FAQ.icon',
    'businessProspects.icon',
    'businessProspects.techStack.logo',
    'developmentService.service.logo',
    'newTech.serviceList.image',
    'caseStudies.cardImage',
    'methodologies.chooseCard.image',
    'processData',
    'chooseUs.content.image',
    'faq.FAQ.icon',
    'clients.brandLogos.brands.logo',
];
export async function getStaticProps() {
    return await fetchSingleTypePageData(populateFields, 'service-details-page');
}

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

export default WebDevelopmentPage;
