forked from UKSOURCE/hailearning.edu.vn
feat: Implement blog API service and refactor components for improved data fetching
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user