import React from 'react'
import Product from '../Product/Product'
import { ProductType } from '@/type/ProductType'

interface Props {
    data: Array<ProductType>;
    start: number;
    limit: number;
}

const TrendingProduct: React.FC<Props> = ({ data, start, limit }) => {
    return (
        <>
            <div className="tab-features-block md:pt-20 pt-10">
                <div className="container">
                    <div className="heading3 text-center">
                        Trending Products
                    </div>

                    <div className="list-product hide-product-sold grid lg:grid-cols-4 grid-cols-2 sm:gap-[30px] gap-[20px] md:mt-10 mt-6">
                        {data.slice(start, limit).map((prd, index) => (
                            <Product key={index} data={prd} type='grid' style='style-1' />
                        ))}
                    </div>
                </div>
            </div>
        </>
    )
}

export default TrendingProduct