import React from 'react'; import clsx from 'clsx'; import { GlowBg } from '@/components/shared/ui/glow-bg'; import { LandingProductCard, ProductCardProps } from './LandingProductCard'; export interface LandingProductSectionProps { title?: string; titleComponent?: React.ReactNode; description?: string; descriptionComponent?: React.ReactNode; products?: ProductCardProps[]; children?: React.ReactNode; className?: string; innerClassName?: string; gridClassName?: string; gridColumns?: 3 | 4; withBackground?: boolean; withBackgroundGlow?: boolean; backgroundGlowVariant?: 'primary' | 'secondary'; variant?: 'primary' | 'secondary'; textPosition?: 'center' | 'left'; } /** * A flexible product grid section component for displaying product cards. * Supports both programmatic products array and declarative children components. */ export function LandingProductCardSection({ title, titleComponent, description, descriptionComponent, products = [], children, className = '', innerClassName = '', gridClassName = '', gridColumns = 3, withBackground = false, withBackgroundGlow = false, backgroundGlowVariant = 'primary', variant = 'primary', textPosition = 'center', }: LandingProductSectionProps) { const hasChildrenToRender = React.Children.count(children) > 0; return (
{withBackgroundGlow ? (
) : null}
{titleComponent || (title && (

{title}

))} {descriptionComponent || (description && (

{description}

))}
{hasChildrenToRender ? children : products.map((product, index) => ( ))}
); }