import { notFound } from 'next/navigation'; import { MDXRemote } from 'next-mdx-remote/rsc'; import { getProductBySlug } from '@/lib/mdx'; import ProductTechnicalData from '@/components/ProductTechnicalData'; import Image from 'next/image'; interface ProductPageProps { params: { locale: string; slug: string[]; }; } const components = { ProductTechnicalData, p: (props: any) =>
, }; export default async function ProductPage({ params }: ProductPageProps) { const { locale, slug } = params; const productSlug = slug[slug.length - 1]; // Use the last segment as the slug const product = await getProductBySlug(productSlug, locale); if (!product) { notFound(); } return (

{product.frontmatter.title}

{product.frontmatter.categories.map((cat, idx) => ( {cat} ))}
{product.frontmatter.images && product.frontmatter.images.length > 0 && (
{/* Note: Images from WC might be external URLs. Next/Image requires configuration for external domains. */} {/* For now using standard img tag if domain not configured, or configure domains. */} {product.frontmatter.title}
{product.frontmatter.images.slice(1, 5).map((img, idx) => (
))}

Contact Us

Need more information about {product.frontmatter.title}?

)}
); }