import type { Metadata } from 'next'
import { getAgentCatalog } from '@/lib/server-products'
import { getSiteHome } from '@/lib/server-site'
import { AgentsPageClient } from './AgentsPageClient'

export const metadata: Metadata = { title: '智能体产品' }

export default async function AgentsPage() {
  const [catalog, siteHome] = await Promise.all([getAgentCatalog(), getSiteHome()])
  const heroAsset = siteHome.assets.find((asset) => asset.key === 'agent_products_hero' && asset.imageUrl)
  return <AgentsPageClient products={catalog.items} categories={catalog.categories} workflow={catalog.workflow} heroAsset={heroAsset || null} />
}
