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

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

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

export default async function RegisterPage({ params }: RegisterPageProps) {
  const { locale } = await params
  const t = await getTranslations({ locale, namespace: 'Auth.register' })

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