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

export default async function ResetPasswordPage({
  params,
  searchParams,
}: {
  params: Promise<{ locale: string }>
  searchParams: Promise<{ token?: string }>
}) {
  const { locale } = await params
  setRequestLocale(locale)
  const { token } = await searchParams
  const t = await getTranslations('Reset')

  return (
    <PageShell title={t('title')}>
      <div className="box-content">
        <div className="body-box-content centered">
          <ResetForm token={token ?? ''} />
        </div>
      </div>
    </PageShell>
  )
}
