import clsx from 'clsx'; import { SupportedLocale } from 'components/layout/navbar/language-control'; import { getCollectionProducts } from 'lib/shopify'; import type { Product } from 'lib/shopify/types'; import Link from 'next/link'; import Label from '../label'; import { GridTileImage } from './tile'; function ThreeItemGridItem({ item, priority }: { item: Product; priority?: boolean }) { const size = item?.variants?.[0]?.selectedOptions?.find((option) => option.name === 'Size'); const image = item?.variants?.[0]?.image; return !!image ? (
) : null; } export async function ThreeItemGrid({ lang }: { lang?: SupportedLocale }) { // Collections that start with `hidden-*` are hidden from the search page. const homepageItems = await getCollectionProducts({ collection: 'hidden-homepage-featured-items', language: lang?.toUpperCase() }); if (!homepageItems[0] || !homepageItems[1] || !homepageItems[2]) return null; const [firstProduct, secondProduct, thirdProduct] = homepageItems; return (
); }