mirror of
https://github.com/vercel/commerce.git
synced 2025-07-23 04:36:49 +00:00
Ported sanity studio to Next js app
This commit is contained in:
28
app/(site)/[locale]/[...slug]/pages/product-page.tsx
Normal file
28
app/(site)/[locale]/[...slug]/pages/product-page.tsx
Normal file
@@ -0,0 +1,28 @@
|
||||
import ProductView from '@/components/product/product-view';
|
||||
interface ProductPageParams {
|
||||
data: object | any;
|
||||
}
|
||||
|
||||
export default function ProductPage({ data }: ProductPageParams) {
|
||||
const product = data;
|
||||
|
||||
const productJsonLd = {
|
||||
'@context': 'https://schema.org',
|
||||
'@type': 'Product',
|
||||
name: product.name,
|
||||
description: product.description,
|
||||
image: product.images[0].asset.url
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: JSON.stringify(productJsonLd)
|
||||
}}
|
||||
/>
|
||||
<ProductView product={product} relatedProducts={[]} />;
|
||||
</>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user