import { productCategories } from '../../data';
import type { IProductCardProps } from '@/components/pages/products/productCard/productCard.d';

// Helper to generate 50 products for a category
export function generateProductsForCategory(
  categoryId: string,
  categoryTitle: string,
): IProductCardProps[] {
  return Array.from({ length: 50 }, (_, i) => ({
    id: `${categoryId}-${i + 1}`,
    title: `${categoryTitle} Product ${i + 1}`,
    size: `W ${10 + i} * L${20 + i}`,
    imageSrc: `/images/product${(i % 4) + 1}.png`, // Example image path
    // Add other fields from IProductCardProps if needed
  }));
}

// Map of categoryId to products
export const productsByCategory: Record<string, IProductCardProps[]> =
  Object.fromEntries(
    productCategories.map((cat) => [
      cat.id,
      generateProductsForCategory(cat.id, cat.title),
    ]),
  );
