mirror of
https://github.com/vercel/commerce.git
synced 2025-07-27 04:01:23 +00:00
♻️ enhan: not show fresh product item when empty
:%s
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import { ProductCard } from '@commerce/types/product'
|
||||
import { Product } from '@framework/schema'
|
||||
import React from 'react'
|
||||
import { CollectionCarcousel } from '..'
|
||||
interface FreshProductsProps {
|
||||
data: Product[]
|
||||
data: ProductCard[]
|
||||
}
|
||||
|
||||
const FreshProducts = ({data}: FreshProductsProps) => {
|
||||
const FreshProducts = ({ data }: FreshProductsProps) => {
|
||||
if (data.length === 0) {
|
||||
return null
|
||||
}
|
||||
return (
|
||||
<div className="w-full">
|
||||
<CollectionCarcousel
|
||||
|
@@ -95,14 +95,6 @@ const dataTest = [
|
||||
const HomeCollection = (props: HomeCollectionProps) => {
|
||||
return (
|
||||
<div className="w-full">
|
||||
<CollectionCarcousel
|
||||
type="highlight"
|
||||
data={dataTest}
|
||||
itemKey="product-1"
|
||||
title="Fresh Products Today"
|
||||
subtitle="Last call! Shop deep deals on 100+ bulk picks while you can."
|
||||
category={"veggie"}
|
||||
/>
|
||||
<CollectionCarcousel
|
||||
data={dataTest}
|
||||
itemKey="product-2"
|
||||
|
Reference in New Issue
Block a user