import { getTranslations, setRequestLocale } from 'next-intl/server'
import { PageHero } from '@/components/page-hero'
import { ProfileView } from '@/components/auth/profile-view'
import { locales, type Locale } from '@/i18n/config'

type PageProps = { params: Promise<{ locale: string }> }

export function generateStaticParams() {
  return locales.map((locale) => ({ locale }))
}

export default async function ProfilePage({ params }: PageProps) {
  const { locale } = await params
  setRequestLocale(locale as Locale)

  const t = await getTranslations('auth.profile')

  return (
    <main>
      <PageHero
        eyebrow={t('hero.eyebrow')}
        title={t('hero.title')}
        description={t('hero.description')}
      />

      <section className="section-padding">
        <div className="container-wide max-w-5xl">
          <ProfileView />
        </div>
      </section>
    </main>
  )
}
