import { getTranslations, setRequestLocale } from 'next-intl/server'
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 (
    <main className="mx-auto max-w-lg px-4 py-8">
      <h1 className="mb-6 text-center text-2xl font-bold text-amber-500">{t('title')}</h1>
      <ResetForm token={token ?? ''} />
    </main>
  )
}
