1- import type { Metadata } from ' next' ;
2- import { notFound } from ' next/navigation' ;
1+ import type { Metadata } from " next" ;
2+ import { notFound } from " next/navigation" ;
33
4- import { GridTileImage } from ' components/grid/tile' ;
5- import Footer from ' components/layout/footer' ;
6- import { Gallery } from ' components/product/gallery' ;
7- import { ProductProvider } from ' components/product/product-context' ;
8- import { ProductDescription } from ' components/product/product-description' ;
9- import { HIDDEN_PRODUCT_TAG } from ' lib/constants' ;
10- import { getProduct , getProductRecommendations } from ' lib/shopware' ;
11- import { Image } from ' lib/shopware/types' ;
12- import Link from ' next/link' ;
13- import { Suspense } from ' react' ;
4+ import { GridTileImage } from " components/grid/tile" ;
5+ import Footer from " components/layout/footer" ;
6+ import { Gallery } from " components/product/gallery" ;
7+ import { ProductProvider } from " components/product/product-context" ;
8+ import { ProductDescription } from " components/product/product-description" ;
9+ import { HIDDEN_PRODUCT_TAG } from " lib/constants" ;
10+ import { getProduct , getProductRecommendations } from " lib/shopware" ;
11+ import type { Image } from " lib/shopware/types" ;
12+ import Link from " next/link" ;
13+ import { Suspense } from " react" ;
1414
1515export async function generateMetadata ( props : {
1616 params : Promise < { handle : string } > ;
@@ -32,8 +32,8 @@ export async function generateMetadata(props: {
3232 follow : indexable ,
3333 googleBot : {
3434 index : indexable ,
35- follow : indexable
36- }
35+ follow : indexable ,
36+ } ,
3737 } ,
3838 openGraph : url
3939 ? {
@@ -42,46 +42,48 @@ export async function generateMetadata(props: {
4242 url,
4343 width,
4444 height,
45- alt
46- }
47- ]
45+ alt,
46+ } ,
47+ ] ,
4848 }
49- : null
49+ : null ,
5050 } ;
5151}
5252
53- export default async function ProductPage ( props : { params : Promise < { handle : string } > } ) {
53+ export default async function ProductPage ( props : {
54+ params : Promise < { handle : string } > ;
55+ } ) {
5456 const params = await props . params ;
5557 const product = await getProduct ( params . handle ) ;
5658
5759 if ( ! product ) return notFound ( ) ;
5860
5961 const productJsonLd = {
60- ' @context' : ' https://schema.org' ,
61- ' @type' : ' Product' ,
62+ " @context" : " https://schema.org" ,
63+ " @type" : " Product" ,
6264 name : product . title ,
6365 description : product . description ,
6466 image : product . featuredImage . url ,
6567 offers : {
66- ' @type' : ' AggregateOffer' ,
68+ " @type" : " AggregateOffer" ,
6769 availability : product . availableForSale
68- ? ' https://schema.org/InStock'
69- : ' https://schema.org/OutOfStock' ,
70+ ? " https://schema.org/InStock"
71+ : " https://schema.org/OutOfStock" ,
7072 priceCurrency : product . priceRange . minVariantPrice . currencyCode ,
7173 highPrice : product . priceRange . maxVariantPrice . amount ,
72- lowPrice : product . priceRange . minVariantPrice . amount
73- }
74+ lowPrice : product . priceRange . minVariantPrice . amount ,
75+ } ,
7476 } ;
7577
7678 return (
7779 < ProductProvider >
7880 < script
7981 type = "application/ld+json"
8082 dangerouslySetInnerHTML = { {
81- __html : JSON . stringify ( productJsonLd )
83+ __html : JSON . stringify ( productJsonLd ) ,
8284 } }
8385 />
84- < div className = "mx-auto max-w-screen- 2xl px-4" >
86+ < div className = "mx-auto max-w-(--breakpoint- 2xl) px-4" >
8587 < div className = "flex flex-col rounded-lg border border-neutral-200 bg-white p-8 md:p-12 lg:flex-row lg:gap-8 dark:border-neutral-800 dark:bg-black" >
8688 < div className = "h-full w-full basis-full lg:basis-4/6" >
8789 < Suspense
@@ -92,7 +94,7 @@ export default async function ProductPage(props: { params: Promise<{ handle: str
9294 < Gallery
9395 images = { product . images . slice ( 0 , 5 ) . map ( ( image : Image ) => ( {
9496 src : image . url ,
95- altText : image . altText
97+ altText : image . altText ,
9698 } ) ) }
9799 />
98100 </ Suspense >
@@ -128,15 +130,14 @@ async function RelatedProducts({ id }: { id: string }) {
128130 < Link
129131 className = "relative h-full w-full"
130132 prefetch = { true }
131- role = "link"
132133 href = { `/product/${ product . path } ` }
133134 >
134135 < GridTileImage
135136 alt = { product . title }
136137 label = { {
137138 title : product . title ,
138139 amount : product . priceRange . maxVariantPrice . amount ,
139- currencyCode : product . priceRange . maxVariantPrice . currencyCode
140+ currencyCode : product . priceRange . maxVariantPrice . currencyCode ,
140141 } }
141142 src = { product . featuredImage ?. url }
142143 fill
0 commit comments