import Error from 'app/error';
import Footer from 'components/layout/footer';
import { Navbar } from 'components/layout/navbar';
import Search from 'components/layout/navbar/search';
import { PriceBox } from 'components/price-box';
import { getCollectionProducts } from 'lib/shopify';
import type { Product } from 'lib/shopify/types';
import Image from 'next/image';
//Todo: change to proper metadata
export const metadata = {
description: 'High-performance ecommerce store built with Next.js, Vercel, and Shopify.',
openGraph: {
type: 'website'
}
};
export default async function HomePage() {
const products = await getCollectionProducts({ collection: 'landing' });
//Todo: change to proper error handling
if (!products[0]) return {products[0].title}
Read more
This is the HTML description for Product 1
', options: [ { id: 'option_001', name: 'Size', values: ['S', 'M', 'L'] } ], priceRange: { maxVariantPrice: { amount: '100.00', currencyCode: 'USD' }, minVariantPrice: { amount: '80.00', currencyCode: 'USD' } }, featuredImage: { url: 'https://cdn.shopify.com/static/sample-images/garnished.jpeg', altText: 'Product 1 Featured Image', width: 500, height: 500 }, seo: { title: 'Product 1 SEO Title', description: 'This is the SEO description for Product 1' }, tags: ['tag1', 'tag2'], updatedAt: new Date().toISOString(), variants: [ { id: 'variant_001', title: 'Variant 1', availableForSale: true, selectedOptions: [ { name: 'Size', value: 'M' } ], price: { amount: '90.00', currencyCode: 'USD' } } ], images: [ { url: 'https://cdn.shopify.com/static/sample-images/garnished.jpeg', altText: 'Product 1 Image 1', width: 500, height: 500 }, { url: 'https://cdn.shopify.com/static/sample-images/garnished.jpeg', altText: 'Product 1 Image 2', width: 400, height: 400 } ] }, { id: 'prod_002', handle: 'product-2', availableForSale: false, title: 'Product 2', description: 'This is the description for Product 2', descriptionHtml: 'This is the HTML description for Product 2
', options: [ { id: 'option_002', name: 'Color', values: ['Red', 'Blue', 'Green'] } ], priceRange: { maxVariantPrice: { amount: '120.00', currencyCode: 'USD' }, minVariantPrice: { amount: '100.00', currencyCode: 'USD' } }, featuredImage: { url: 'https://cdn.shopify.com/static/sample-images/garnished.jpeg', altText: 'Product 2 Featured Image', width: 500, height: 500 }, seo: { title: 'Product 2 SEO Title', description: 'This is the SEO description for Product 2' }, tags: ['tag3', 'tag4'], updatedAt: new Date().toISOString(), variants: [ { id: 'variant_002', title: 'Variant 2', availableForSale: false, selectedOptions: [ { name: 'Color', value: 'Red' } ], price: { amount: '110.00', currencyCode: 'USD' } } ], images: [ { url: 'https://cdn.shopify.com/static/sample-images/garnished.jpeg', altText: 'Product 2 Image 1', width: 500, height: 500 } ] } ];