import { Button } from "@/components/ui/button"; import { ArrowRight } from "lucide-react"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Badge } from "@/components/ui/badge"; import { Separator } from "@/components/ui/separator"; import { Calendar, Clock, User } from "lucide-react"; import { PlusSigns } from "../icons/plus-signs"; const BlogPosts = ({ posts, collection = "", }: { posts: any[]; collection?: string; }) => { // Get the first post as the featured post const featuredPost = posts[0]; const remainingPosts = posts.slice(1); const hrefFor = (post: any) => collection ? `/${collection}/${post.id}/` : `/${post.id}/`; return (
{/* Featured Post */}
{featuredPost.data.title}
Featured Post

{featuredPost.data.title}

{featuredPost.data.description}

{new Date(featuredPost.data.pubDate).toLocaleDateString( "en-US", { month: "long", day: "numeric", year: "numeric", }, )}
5 min read
{/* Regular Posts Grid */}

Recent Articles

{remainingPosts.map((post) => (
{post.data.title}

{post.data.title}

{post.data.description}

{new Date(post.data.pubDate).toLocaleDateString( "en-US", { month: "short", day: "numeric", year: "numeric", }, )}
5 min read
))}
); }; export { BlogPosts };