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('ConfirmNewEmail')
  return (
    <PageShell title={t('title')}>
      <div className="box-content">
        <div className="body-box-content centered">
          <ConfirmClient hash={hash ?? ''} endpoint="/api/account/confirm-new-email" namespace="ConfirmNewEmail" showLogin />
        </div>
      </div>
    </PageShell>
  )
}
