import { Link } from 'react-router-dom'; import { Swiper, SwiperSlide } from 'swiper/react'; import { Autoplay, Pagination } from 'swiper/modules'; import ProductCard from './ProductCard'; import type { Product, ProductsSectionPayload } from '@homaroma/types'; // Import Swiper styles import 'swiper/css'; import 'swiper/css/pagination'; interface DynamicProductsProps { payload: ProductsSectionPayload & { products?: Product[] }; } export default function DynamicProducts({ payload }: DynamicProductsProps) { const { title, subtitle, products = [], layout = 'grid', enableQuickShop = false } = payload; return (

{title || "Featured Picks"}

{subtitle && (

{subtitle}

)}
View All Collection →
{products.length === 0 ? (
No products found in this section
) : layout === 'carousel' ? (
{products.map((p) => ( ))}
) : (
{products.map((p) => (
))}
)}
); }