"use client"; import { useState } from "react"; import type { Swiper as SwiperType } from "swiper"; import { FreeMode } from "swiper/modules"; import { Swiper, SwiperSlide } from "swiper/react"; import "swiper/css"; import "swiper/css/free-mode"; import ProductCard from "./ui/ProductCard"; import SectionHeader from "./ui/SectionHeader"; import CarouselNav from "./ui/CarouselNav"; import type { ProductCardData } from "@/lib/types"; export default function ProductCarousel({ title, desc, href, products, }: { title: string; desc?: string; href: string; products: ProductCardData[]; }) { const [swiper, setSwiper] = useState(null); if (products.length === 0) return null; return (
} />
{products.map((product) => ( ))}
); }