import Link from "next/link"; import type { BlogPost } from "@/types/blog"; import { getCmsImageUrl } from "@/utils"; interface NewsListProps { blogs?: BlogPost[]; categorySlug?: string; tagSlug?: string; } export default function NewsList({ blogs = [], categorySlug, tagSlug }: NewsListProps) { // Use blogs from props (already filtered by API) const posts = blogs; // Additional client-side filtering if needed (though API should handle this) if (categorySlug || tagSlug) { // If filters are provided but blogs are not pre-filtered, filter here // This is a fallback - ideally API should handle filtering } return (
{posts.map((post, index) => (
{post.title}
  • By {post.author}
  • {post.publishedAt}
  • {post.commentsCount} Comments

{post.title}

{post.excerpt}

VIEW MORE
))}
); }