---
import Layout from '@/layouts/Layout.astro'
import Footer from '@/components/Footer.astro'
import Navbar from '@/components/Navbar.astro'
// import Dynamic from '@/components/Dynamic.astro'
import { getContentList } from '@/services/apis'

function getName(item = {}) {
  return (
    item[`categaryName${lang.charAt(0).toUpperCase() + lang.slice(1)}`] ||
    item.categaryNameEn ||
    item.categaryNameZh
  )
}

const { categaryId, lang = 'zh' } = Astro.params
const categary = Astro.locals._menus?.find(
  (item) => item.categaryId == categaryId
)
const title = getName(categary)

// const contentList = await getContentList(categaryId);
---

<Layout title={title}>
  <!-- 导航栏 -->
  <Navbar lang={lang} />

  <!-- <Dynamic contentList={contentList} lang={lang} /> -->

  <Footer lang={lang} />
</Layout>
