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

export async function generateMetadata({ params }: { params: Promise<{ lang: string, slug: string }> }) {
  const { lang, slug } = await params
  const dict = await getDictionary(lang as 'en' | 'tr')
  
  // Dynamic title based on slug if possible, or just section title
  return {
    title: `News - Ayris Apart`,
    description: dict.news_page.subtitle,
  }
}

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

  return <NewsDetailClient lang={lang} slug={slug} dict={dict} />
}
