import { getTranslations, setRequestLocale } from 'next-intl/server'
import { PageShell } from '@/components/PageShell'
import { getRealmName } from '@/lib/realm'
import { ActivateClient } from './ActivateClient'

export default async function ActivatePage({
  params,
  searchParams,
}: {
  params: Promise<{ locale: string }>
  searchParams: Promise<{ act?: string }>
}) {
  const { locale } = await params
  setRequestLocale(locale)
  const { act } = await searchParams
  const t = await getTranslations('Activate')
  const realm = await getRealmName()

  return (
    <PageShell title={t('title')}>
      <div className="box-content">
        <div className="body-box-content centered">
          <ActivateClient hash={act ?? ''} realm={realm} />
        </div>
      </div>
    </PageShell>
  )
}
