import 'server-only'; import Link from 'next/link'; import Image from 'next/image'; import { getCollectionProducts, getMenu } from 'lib/shopify'; import { PriceRanges } from '/components/price.js'; import styles from './styles.module.scss'; export async function HomeProduct({ product }) { const featuredImage = product?.images?.[0]; const collections = product?.collections?.nodes; return ( {featuredImage?.altText}

{product?.title}

{collections && collections.length > 0 && (

{`(${collections ?.map(collection => collection?.title) .join(', ')})`}

)} ); } //TODO: suspense export async function HomeProductsList({ collection }) { const products = await getCollectionProducts({ collection, }); // console.log({ collection, products }); // const num = 4; // console.log({ // price: products[num].priceRange, // compareAt: products[num].compareAtPriceRange, // title: products[num].title, // }); return ( <> {products.length === 0 ? (

{`No products found`}

) : ( )} ); } //TODO: suspense export async function TypesNav() { const typesMenu = await getMenu('types-nav'); return (

Filter: {typesMenu?.map((menuItem, i) => ( {`${menuItem?.title}`} {`${ i == typesMenu.length - 1 ? '.' : ',' } `} ))}

); } export const HomeNav = () => (
Information
);