"use client"; import Image from "next/image"; import Link from "next/link"; import { useRef } from "react"; type Article = { title: string; date: string; image: string; href?: string; }; export function ArticleCarousel({ articles, ariaLabel, }: { articles: Article[]; ariaLabel: string; }) { const carouselRef = useRef(null); const scrollCarousel = (direction: "next" | "previous") => { const amount = carouselRef.current ? carouselRef.current.clientWidth * 0.7 : 320; carouselRef.current?.scrollBy({ left: direction === "next" ? -amount : amount, behavior: "smooth", }); }; return (
{articles.map((article) => (
{article.title}

{article.title}

ادامه

))}
); }