import { MainSection } from "@/components/pages/Not-found/MainSection";
import { getPayload } from "payload";
import config from '../../../../payload.config'
import { getCurrentLocale } from '@/locales/server'

export default async function NotFound() {
  const payload = await getPayload({ config });
  const locale = await getCurrentLocale()
  const notFound = await payload.findGlobal({
    slug: 'not-found',
    depth: 1,
    locale,
  })

  return (
    <MainSection {...notFound} />
  )
}
