feat: Implement blog API service and refactor components for improved data fetching

This commit is contained in:
Wini_Fy
2026-02-04 15:33:02 +07:00
parent d46c420aaf
commit 9a71d39ebf
16 changed files with 790 additions and 149 deletions

View File

@@ -1,5 +1,6 @@
import Link from "next/link";
import { fetchCategories, fetchRecentBlogs, fetchPopularTags } from "@/api/blog";
import { fetchCategories, fetchRecentBlogs, fetchPopularTags } from "@/api/blogsApi";
import { getCmsImageUrl } from "@/utils";
interface SidebarProps {
searchQuery?: string;
@@ -67,11 +68,8 @@ export default async function Sidebar({ searchQuery }: SidebarProps) {
<div key={post.slug} className="recent-items">
<div className="recent-thumb">
<img
src={post.thumbnail || "/assets/img/inner-page/news-details/details-1.jpg"}
src={getCmsImageUrl(post.thumbnail) || "/assets/img/inner-page/news-details/details-1.jpg"}
alt={post.title}
width={88}
height={80}
style={{ objectFit: 'cover' }}
/>
</div>
<div className="recent-content">