import {notFound} from 'next/navigation'

import ProductPageIndex from '@/components/pages/product'

export default async function Products({
	params
}: {
	params: Promise<{slug?: string}>
}) {
	const {slug} = await params
	const [uri] = slug || []
	const id = (uri || '').match(/^(\d+)-./)
	if (!id) notFound()

	return <ProductPageIndex id={id[1]} />
}
