import { getDictionary } from "@/dictionaries/get-dictionary"
import NewsClient from "./NewsClient"

export async function generateMetadata({ params }: { params: Promise<{ lang: string }> }) {
  const { lang } = await params
  const dict = await getDictionary(lang as 'en' | 'tr')
  return {
    title: `${dict.news_page.title} - Ayris Apart`,
    description: dict.news_page.excerpt,
  }
}

export default async function NewsPage({ params }: { params: Promise<{ lang: string }> }) {
  const { lang } = await params
  const dict = await getDictionary(lang as 'en' | 'tr')

  return <NewsClient lang={lang} dict={dict} />
}
