import { Link } from "react-router-dom"; import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; import { Calendar, MessageCircle, Share2, ThumbsUp, User } from "lucide-react"; import type { BlogPost } from "./types"; interface BlogPostGridProps { posts: BlogPost[]; placeholderImage?: string; emptyState?: React.ReactNode; } const BlogPostGrid = ({ posts, placeholderImage = "/placeholder.svg", emptyState, }: BlogPostGridProps) => { if (!posts.length) { return (
{emptyState || "No posts found. Try adjusting your filters."}
); } return (
{posts.map((post, index) => ( {post.image ? (
{post.title}
) : (
Placeholder
)}
{post.category || "General"} {post.readTime ? ( {post.readTime} ) : null}
{post.title}

{post.excerpt}

{post.author || "AeThex Team"} {post.date || "Recently"}
{post.likes?.toLocaleString() ?? 0} {post.comments?.toLocaleString() ?? 0}
))}
); }; export default BlogPostGrid;