/*
  This page is for the Terms of services.
  It includes a banner with a title and a link to the home page.
  It also includes a section with the Terms of services.
*/
import PageBannerTitle from '@/src/components/PageBannerTitle';
import getCMSData from '@/src/ssrapi/getCMSData';
import { notFound } from 'next/navigation';
import React from 'react';
import styles from './page.module.scss';
import { CKeditorContent } from '@/src/components/CKeditorContent/CKeditorContent';
// Banner Content
const BannerDetails = {
    BannerTitle: "Terms of services",
    EffectiveDate: "20/11/2024",
    EffectiveDateText: "Effective Date"
};


const page: React.FC = async () => {
    //get terms of services cms data from server side API
    const termsOfServicesCMSData = await getCMSData('terms-and-conditions');

    //if no data found, then show not found page
    if (!termsOfServicesCMSData?.data) {
        notFound();
    }
    return (
        <main className={`main-mt mb-[30px] lg:mb-[40px]`}>
            <PageBannerTitle CommonDetails={BannerDetails} />
            <section className={`mt-5 md:mt-7 lg:mt-0`}>
                <div className={`container`}>
                    <div className={`${styles.TermsAndConditionWrapper}`}>
                        <CKeditorContent htmlContent={termsOfServicesCMSData?.data?.description as string} />
                    </div>
                </div>
            </section>
        </main>
    )
}

export default page