feat(blog): add material freshness and authorship

This commit is contained in:
devops committed 2026-10-20 05:36:03 +00:00
1 parent 3f5258a76c
commit 51ca8c7e34
24 files changed
+187 -52

No files matched your search

+14 -11
View File
@@ -26,6 +26,7 @@ import { productService } from "../lib/services/productService";
import { useRouter } from 'next/navigation';
import Image from 'next/image';
import SafeImage from './SafeImage';
import { BLOG_TEAM_FALLBACK, publicationDate, validContentUpdatedAt, persianDate } from '../lib/blogDates';
export interface BlogCategory {
id: string;
@@ -42,6 +43,11 @@ export interface BlogPostItem {
imageAlt?: string;
date: string;
author: string;
authorTeam?: string;
authorRole?: string;
publishedAt?: string;
createdAt?: string;
contentUpdatedAt?: string;
content: string;
category?: string;
categoryId?: string;
@@ -324,10 +330,8 @@ export default function BlogPage({
<div className="bg-canina-blue/10 px-3.5 py-1 rounded-full uppercase tracking-wider">
{featuredPost.category || "پژوهش بالینی"}
</div>
<div className="flex items-center gap-1 text-medical-gray-400">
<Calendar className="w-3.5 h-3.5" />
{featuredPost.date}
</div>
<div className="flex items-center gap-1 text-medical-gray-400"><Calendar className="w-3.5 h-3.5" />تاریخ انتشار: <time dateTime={publicationDate(featuredPost)}>{persianDate(publicationDate(featuredPost))}</time></div>
{validContentUpdatedAt(featuredPost) && <div className="text-medical-gray-400">آخرین به‌روزرسانی: <time dateTime={validContentUpdatedAt(featuredPost)}>{persianDate(validContentUpdatedAt(featuredPost))}</time></div>}
<div className="flex items-center gap-1 text-medical-gray-400">
<Clock className="w-3.5 h-3.5" />
{featuredPost.readingTime || 4} دقیقه مطالعه
@@ -349,8 +353,9 @@ export default function BlogPage({
<User className="w-5 h-5" />
</div>
<div className="text-xs">
<div className="font-black text-medical-gray-900">{featuredPost.author}</div>
<div className="font-bold text-medical-gray-400">تیم پژوهش کنینا</div>
<div className="font-black text-medical-gray-900">نویسنده: {featuredPost.author}</div>
<div className="font-bold text-medical-gray-400">تیم: {featuredPost.authorTeam || BLOG_TEAM_FALLBACK}</div>
{featuredPost.authorRole && <div className="font-bold text-medical-gray-400">{featuredPost.authorRole}</div>}
</div>
</div>
<div className="flex items-center gap-2 text-canina-blue font-black text-sm">
@@ -406,10 +411,8 @@ export default function BlogPage({
</div>
<div className="p-4 sm:p-7">
<div className="flex items-center justify-between text-[11px] font-bold text-medical-gray-400 mb-3">
<div className="flex items-center gap-1">
<Calendar className="w-3 h-3" />
{post.date}
</div>
<div className="flex items-center gap-1"><Calendar className="w-3 h-3" />تاریخ انتشار: <time dateTime={publicationDate(post)}>{persianDate(publicationDate(post))}</time></div>
{validContentUpdatedAt(post) && <div>آخرین به‌روزرسانی: <time dateTime={validContentUpdatedAt(post)}>{persianDate(validContentUpdatedAt(post))}</time></div>}
<div className="flex items-center gap-3">
<div className="flex items-center gap-1">
<Clock className="w-3 h-3" />
@@ -433,7 +436,7 @@ export default function BlogPage({
<div className="px-4 sm:px-7 pb-4 sm:pb-6 pt-2.5 border-t border-medical-gray-100 flex items-center justify-between">
<div className="text-[11px] font-bold text-medical-gray-500 flex items-center gap-1.5">
<User className="w-3.5 h-3.5 text-medical-gray-400" />
<span>{post.author}</span>
<span>نویسنده: {post.author}</span><span>تیم: {post.authorTeam || BLOG_TEAM_FALLBACK}</span>
</div>
<div className="flex items-center gap-1 text-canina-blue font-black text-xs group-hover:underline">
<span>مطالعه</span>