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

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

const populateFields = [
    'seo.ogImage',
    'seo.multiStructureData',
    'hero',
    'appDevelopment.devServices.logo',
    'caseStudies.image',
];

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

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

export default ServicesPage;
