import { Layout } from '@components/common' import { Grid, Marquee, Hero } from '@components/ui' import { ProductCard } from '@components/product' // import HomeAllProductsGrid from '@components/common/HomeAllProductsGrid' import type { GetStaticPropsContext, InferGetStaticPropsType } from 'next' import { getConfig } from '@framework/api' import getAllProducts from '@framework/product/get-all-products' import getSiteInfo from '@framework/common/get-site-info' import getAllPages from '@framework/common/get-all-pages' import Features from '@commerce/utils/features' export async function getStaticProps({ preview, locale, }: GetStaticPropsContext) { const config = getConfig({ locale }) const { products } = await getAllProducts({ variables: { first: 12 }, config, preview, }) const { categories, brands } = await getSiteInfo({ config, preview }) const { pages } = await getAllPages({ config, preview }) const isWishlistEnabled = Features.isEnabled('wishlist') return { props: { products, categories, brands, pages, commerceFeatures: { wishlist: isWishlistEnabled, }, }, revalidate: 1440, } } export default function Home({ products, brands, categories, commerceFeatures, }: InferGetStaticPropsType) { return ( <> {products.slice(0, 3).map((product, i) => ( ))} {products.slice(0, 3).map((product, i) => ( ))} {products.slice(0, 3).map((product, i) => ( ))} {products.slice(0, 3).map((product, i) => ( ))} {/* */} ) } Home.Layout = Layout