import type { Metadata } from 'next'
import { getTranslations } from 'next-intl/server'
import AuthContainer from '@/components/frontend/auth/AuthContainer'
import ForgotPasswordForm from '@/components/frontend/auth/ForgotPasswordForm'

interface ForgotPasswordPageProps {
  params: Promise<{ locale: string }>
}

export async function generateMetadata({ params }: ForgotPasswordPageProps): Promise<Metadata> {
  const { locale } = await params
  const t = await getTranslations({ locale, namespace: 'Auth.forgot' })
  return {
    title: t('metaTitle'),
    description: t('metaDescription'),
  }
}

export default async function ForgotPasswordPage({ params }: ForgotPasswordPageProps) {
  const { locale } = await params
  const t = await getTranslations({ locale, namespace: 'Auth.forgot' })

  return (
    <AuthContainer
      title={t('title')}
      subtitle={t('subtitle')}
      alternateText={t('alternateText')}
      alternateLink="/login"
      alternateLinkText={t('alternateLinkText')}
    >
      <ForgotPasswordForm />
    </AuthContainer>
  )
}
