import React from 'react'
import config from '../../../../payload.config'
import { getPayload } from 'payload'
import { MainSection } from '@/components/pages/PrivacyPolicy/MainSection'
import { getCurrentLocale } from '@/locales/server'

interface Props {}

export const revalidate = 100

const page: React.FC<Props> = async ({}) => {
  const payload = await getPayload({ config })
  const locale = await getCurrentLocale()
  const privacyPolicy = await payload.findGlobal({
    slug: 'privacy-policy',
    depth: 3,
    locale,
  })

  return (
    <>
      <MainSection {...privacyPolicy} initialActiveTab="privacy policy" />
    </>
  )
}

export default page
