import Cart from 'components/cart';
import OpenCart from 'components/cart/open-cart';
import { GridTileImage } from 'components/grid/tile';
import { Gallery } from 'components/product/gallery';
import { ProductDescription } from 'components/product/product-description';
import { getContentLandingPageConfig } from 'lib/aspire';
import { Store } from 'lib/aspire/types';
import { getProductRecommendations } from 'lib/shopify';
import { Image } from 'lib/shopify/types';
import Link from 'next/link';
import { Suspense } from 'react';
export default async function Page({ params }: { params: { ContentLandingPage: string } }) {
const config = await getContentLandingPageConfig(params.ContentLandingPage);
if (!config.product) {
return
Product not found
;
}
const productJsonLd = {
'@context': 'https://schema.org',
'@type': 'Product',
name: config.product.title,
description: config.product.description,
image: config.product.featuredImage.url,
offers: {
'@type': 'AggregateOffer',
availability: config.product.availableForSale
? 'https://schema.org/InStock'
: 'https://schema.org/OutOfStock',
priceCurrency: config.product.priceRange.minVariantPrice.currencyCode,
highPrice: config.product.priceRange.maxVariantPrice.amount,
lowPrice: config.product.priceRange.minVariantPrice.amount
}
};
return (
<>
}
>
({
src: image.url,
altText: image.altText
}))}
/>
>
);
}
async function RelatedProducts({ store, id }: { store: Store; id: string }) {
const relatedProducts = await getProductRecommendations(store, id);
if (!relatedProducts.length) return null;
return (
Related Products
{relatedProducts.map((product) => (
-
))}
);
}