"use client"; import { useRef } from "react"; import Link from "next/link"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { Container } from "@/components/Container"; import { Placeholder } from "@/components/Placeholder"; import { blogs as sampleBlogs } from "@/lib/data"; import { blogHref, blogImage, type BlogPost } from "@/lib/blog"; import { formatFaDate } from "@/lib/format"; export function BlogCarousel({ posts }: { posts?: BlogPost[] }) { const scroller = useRef(null); const list = posts && posts.length ? posts.map((post) => ({ id: post.id, title: post.title, excerpt: post.abstract || "", date: formatFaDate(post.publishedAt || post.createdAt), image: blogImage(post), href: blogHref(post), })) : sampleBlogs.map((post) => ({ ...post, href: "/blog", })); return (

آخرین مطالب مجله سلامت

نکته‌های کاربردی از داروسازان داروخانه

مشاهده همه
{list.map((post) => (

{post.date}

{post.title}

{post.excerpt}

))}
); }