Files
nobat724_front/components/blogs/latestArticles/Article.js
T
hamed eb83762016 Refactor blog components for improved tag filtering and related content display
- Added `getBlogTagFacets` API call to fetch blog tags based on city scope.
- Updated `BlogsPage` to read selected tag from URL and handle tag changes with URL updates.
- Modified `Title` component to display tags from the new API and reflect active tag state.
- Enhanced breadcrumb navigation to link categories to their respective pages.
- Adjusted related content section to display articles from the same category and fixed layout issues.
- Corrected heading hierarchy across various components for better SEO compliance.
- Ensured consistent styling and spacing in related content items.
2026-07-29 14:23:37 +03:30

52 lines
1.8 KiB
JavaScript

import CustomLoading from "@/app/component/loading/Custom";
import TextLoading from "@/app/component/loading/Text";
import Image from "next/image";
import Link from "next/link";
import { blogCover, convertTimestampToJalali } from "@/helper";
function Article({ data }) {
const imageSrc = blogCover(data);
const createdDate = data.created ? convertTimestampToJalali(data.created) : "";
return (
<li className="rounded-[8px] overflow-hidden bg-[#FFF] shadow-[0px_0px_41px_0px_rgba(173,_181,_189,_0.15)]">
<CustomLoading width="full" height={200}>
<Link href={`/blog/${data.uuid}`}>
<Image
className="w-full h-[217px] object-cover"
alt={data.title || "article-img"}
src={imageSrc}
height={217}
width={392}
/>
</Link>
</CustomLoading>
<div className="p-[12px] md:p-[14px] lg:p-[16px]">
<TextLoading width={150} height={18}>
<Link href={`/blog/${data.uuid}`}>
<h2 className="text-[#3B3B3B] mb-[12px] md:mb-[14px] lg:mb-[16px] text-[16px] font-bold line-clamp-2">
{data.title}
</h2>
</Link>
</TextLoading>
<div className="flex items-center justify-start gap-[16px]">
<TextLoading width={100} height={18}>
<p className="text-[#9B9B9B] text-[14px] font-medium">
{data.author && `نویسنده: ${data.author}`}
</p>
</TextLoading>
{createdDate && (
<TextLoading width={110} height={18}>
<p className="text-[#9B9B9B] text-[14px] font-medium">
{createdDate}
</p>
</TextLoading>
)}
</div>
</div>
</li>
);
}
export default Article;