--- import { getPostImageUrl } from '@lib/pb'; interface Post { id: string; slug: string; title: string; description: string; category: string; categoryColor: string; date: string; readTime: string; readmeTime?: string; image: string; } interface Props { posts: Post[]; currentSlug?: string; } const { posts, currentSlug } = Astro.props; const formatDate = (date: string) => { return new Date(date).toLocaleDateString('ru-RU', { day: 'numeric', month: 'long', year: 'numeric' }); }; const filteredPosts = currentSlug ? posts.filter((post: Post) => post.slug !== currentSlug) : posts; --- Похожие статьи {filteredPosts.slice(0, 3).map((post: Post) => ( {post.category} {post.title} {post.description} {formatDate(post.date)} {post.readTime} мин. ))}
{post.description}