mirror of
https://github.com/vercel/commerce.git
synced 2025-05-19 16:07:01 +00:00
38 lines
699 B
TypeScript
38 lines
699 B
TypeScript
import React, { FC } from 'react'
|
|
|
|
import { ProductCard } from '@components/product'
|
|
import { Grid, Marquee, Hero } from '@components/ui'
|
|
import { ModuleWithInit } from '@agility/nextjs'
|
|
|
|
interface ICustomData {
|
|
bestSelling: any
|
|
}
|
|
|
|
interface IModule {
|
|
}
|
|
|
|
|
|
const BestsellingProducts: ModuleWithInit<IModule, ICustomData> = ({ customData }) => {
|
|
|
|
const bestSelling = customData.bestSelling
|
|
|
|
return (
|
|
<Marquee variant="secondary">
|
|
{bestSelling.slice(0, 12).map(({ node }: any) => (
|
|
<ProductCard
|
|
key={node.path}
|
|
product={node}
|
|
variant="slim"
|
|
imgWidth={320}
|
|
imgHeight={320}
|
|
imgLayout="fixed"
|
|
/>
|
|
))}
|
|
</Marquee>
|
|
)
|
|
}
|
|
|
|
|
|
export default BestsellingProducts
|
|
|