"use client"; import { useRef } from "react"; import Link from "next/link"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { Container } from "@/components/Container"; import { ProductCard } from "@/components/ui/ProductCard"; import type { Product } from "@/lib/data"; type Props = { id?: string; title: string; subtitle?: string; href?: string; products: Product[]; }; export function ProductCarousel({ id, title, subtitle, href = "/products", products }: Props) { const scroller = useRef(null); const scrollBy = (dir: number) => { scroller.current?.scrollBy({ left: dir * -280, behavior: "smooth" }); }; if (!products.length) return null; return (

Parts

{title}

{subtitle ?

{subtitle}

: null}
مشاهده همه
{products.map((product) => (
))}
); }