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

import { META_DATA_CONSTANT } from 'constants/meta.constant';

import MetaTag from 'components/common/seo/Seo';
import { fetchSingleTypePageData } from '@/helpers/utilities/fetchAPI';
const ContactUs = dynamic(() => import('components/contact-us/ContactUs'));

const POPULATE_FIELDS = ['content', 'contactDetails.logo', 'social.icon'];

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

const ContactUsPage: NextPage = ({ data }: any) => {
    return (
        <>
            <MetaTag content={META_DATA_CONSTANT.CONTACT_US} />
            <ContactUs contactData={data.data?.attributes} />
        </>
    );
};

export default ContactUsPage;
