forked from UKSOURCE/hailearning.edu.vn
feat: Implement blog API service and refactor components for improved data fetching
This commit is contained in:
@@ -18,6 +18,12 @@ export default function NewsSection({
|
||||
searchQuery,
|
||||
pagination,
|
||||
}: NewsSectionProps) {
|
||||
const basePath = categorySlug
|
||||
? `/blog/category/${categorySlug}`
|
||||
: tagSlug
|
||||
? `/blog/tag/${tagSlug}`
|
||||
: "/blog";
|
||||
|
||||
return (
|
||||
<section className="news-standard-section section-padding fix">
|
||||
<div className="container">
|
||||
@@ -29,7 +35,7 @@ export default function NewsSection({
|
||||
{pagination && pagination.total > 1 && (
|
||||
<div className="row g-4 mt-4">
|
||||
<div className="col-12">
|
||||
<Pagination basePath="/blog" pagination={pagination} searchQuery={searchQuery} />
|
||||
<Pagination basePath={basePath} pagination={pagination} searchQuery={searchQuery} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user