import BreadCrumb from '@/components/bread-crumb'
import Wrap from '@/components/wrap'
import Purchase, {TabType} from '@/components/composites/purchase'

export type ProductPageProps = {
  searchParams?: Promise<{
    type?: TabType
  }>
}

export default async function ProductPage(props: ProductPageProps) {
  return (
    <main className="mt-20">
      <Wrap className="flex flex-col py-8 gap-4">
        <BreadCrumb items={[
          {label: '产品中心', href: '/product'},
        ]}/>
        <Purchase defaultTab={(await props.searchParams)?.type ?? 'short'}/>
      </Wrap>
    </main>
  )
}
