diff --git a/app/page.js b/app/page.js index e5cd00295..175972b67 100644 --- a/app/page.js +++ b/app/page.js @@ -1,3 +1,46 @@ -export default function Page() { - return

Hello, Next.js!

; +import Link from 'next/link'; +import Image from 'next/image'; + +import { getCollectionProducts } from 'lib/shopify'; + +export async function HomeProduct({ product }) { + const featuredImage = product?.images?.[0]; + + return ( + + {featuredImage?.altText} +

{product?.title}

+ + ); +} + +export default async function HomePage() { + const collection = process.env.HOMEPAGE_COLLECTION; + const products = await getCollectionProducts({ + collection, + }); + + console.log({ collection, products }); + // console.log({ img: products[1].images }); + + return ( + <> + {products.length === 0 ? ( +

{`No products found`}

+ ) : ( + + )} + + ); }