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

import StrapiSeo from '@/components/common/seo/StrapiSeo';
import { fetchSingleTypePageData } from '@/helpers/utilities/fetchAPI';
const ConvexCrm = dynamic(() => import('@/components/solution/convex-crm/ConvexCrm'));

const populateFields = [
    'seo.ogImage',
    'seo.multiStructureData',
    'hero.logo',
    'hero.image',
    'hero.heroCard',
    'convex.image',
    'convex.crmDetails',
    'convex.whyCRM',
    'benefits.benefitsCard.logo',
    'app.image',
];

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

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

export default ConvexCrmPage;
