import { GridTileImage } from 'components/grid/tile'; import { Gallery } from 'components/product/gallery'; import { ProductDescription } from 'components/product/product-description'; import { getProductById, getProductRecommendations } from 'lib/shopify'; import { ContentLandingPages, Image, Store } from 'lib/shopify/types'; import Link from 'next/link'; import { Suspense } from 'react'; const lookupContentLandingPage = async (contentLandingPageId: string) => { const contentLandingPages: ContentLandingPages = { ABC: { contentLandingPageId: 'ABC', content: { contentId: 'ABC-123', contentUrl: 'https://vercel.com' }, brand: { brandId: '123456789', companyName: 'Vercel' }, store: { domain: 'https://test-app-furie.myshopify.com', key: '30f0c9b2ee5c69d6c0de2e7a048eb6b4' }, productId: 'gid://shopify/Product/8587441176812' }, '123': { contentLandingPageId: '123', content: { contentId: '123-ABC', contentUrl: 'https://vercel.com' }, brand: { brandId: '123456789', companyName: 'Vercel' }, store: { domain: 'https://test-app-furie.myshopify.com', key: '30f0c9b2ee5c69d6c0de2e7a048eb6b4' }, productId: 'gid://shopify/Product/8587440849132' } }; const contentLandingPage = contentLandingPages[contentLandingPageId]; if (!contentLandingPage) { throw new Error('Content Landing Page not found'); } const product = await getProductById(contentLandingPage.store, contentLandingPage?.productId); return { ...contentLandingPage, product }; }; export default async function Page({ params }: { params: { ContentLandingPage: string } }) { const instance = await lookupContentLandingPage(params.ContentLandingPage); if (!instance.product) { return
Product not found
; } const productJsonLd = { '@context': 'https://schema.org', '@type': 'Product', name: instance.product.title, description: instance.product.description, image: instance.product.featuredImage.url, offers: { '@type': 'AggregateOffer', availability: instance.product.availableForSale ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock', priceCurrency: instance.product.priceRange.minVariantPrice.currencyCode, highPrice: instance.product.priceRange.maxVariantPrice.amount, lowPrice: instance.product.priceRange.minVariantPrice.amount } }; return ( <>