import { ForgotPasswordForm } from '@/components/auth/ForgotPasswordForm'
import { isLocale, isMode, type Locale } from '@/lib/localization/config'
import { notFound } from 'next/navigation'
import { Suspense } from 'react'

export default async function ForgotPasswordPage({
  params,
}: {
  params: Promise<{ locale: string; mode: string }>
}) {
  const { locale: localeValue, mode } = await params
  if (!isLocale(localeValue)) notFound()
  if (!isMode(mode)) notFound()
  const locale = localeValue as Locale

  return (
    <Suspense fallback={null}>
      <ForgotPasswordForm locale={locale} />
    </Suspense>
  )
}
