import { getTranslations } from 'next-intl/server'
import { SubmitForm } from '@/components/SubmitForm'
import { ReassuranceSection } from '@/components/ReassuranceSection'

export default async function Home({
  params,
}: {
  params: Promise<{ locale: string }>
}) {
  const { locale } = await params
  const t = await getTranslations({ locale, namespace: 'home' })

  return (
    <main>
      <section
        className="flex flex-col items-center justify-center px-6 pt-20 pb-16 text-center"
        aria-labelledby="hero-heading"
      >
        <h1
          id="hero-heading"
          className="text-4xl md:text-5xl font-bold tracking-tight text-gray-900 dark:text-gray-50 mb-4 max-w-2xl"
        >
          {t('heading')}
        </h1>
        <p className="text-lg text-gray-500 dark:text-gray-400 mb-10">
          {t('subheading')}
        </p>
        <SubmitForm />
        <p className="mt-5 text-xs text-gray-400 dark:text-slate-500 tracking-wide uppercase">
          {t('formats')}
        </p>
      </section>

      <ReassuranceSection locale={locale} />
    </main>
  )
}
