import { getTranslations, setRequestLocale } from 'next-intl/server'
import { PageShell } from '@/components/PageShell'
import { ConfirmClient } from '@/components/ConfirmClient'

export default async function Page({ params, searchParams }: { params: Promise<{ locale: string }>; searchParams: Promise<{ hash?: string }> }) {
  const { locale } = await params
  setRequestLocale(locale)
  const { hash } = await searchParams
  const t = await getTranslations('ConfirmOldEmail')
  return (
    <PageShell title={t('title')}>
      <div className="box-content">
        <div className="body-box-content centered">
          <ConfirmClient hash={hash ?? ''} endpoint="/api/account/confirm-old-email" namespace="ConfirmOldEmail" />
        </div>
      </div>
    </PageShell>
  )
}
