import { pb, getPbImage } from "@/lib/pb"; import { notFound } from "next/navigation"; import Link from "next/link"; import { ArrowLeft, Calendar, Clock, ShieldCheck } from "lucide-react"; import { getDictionary } from "@/lib/dictionaries"; interface PBPost { id: string; collectionId: string; title: string; slug: string; content: string; image: string; lang: string; created: string; published: boolean; } interface Props { params: Promise<{ lang: string; slug: string }>; } export default async function BlogPostPage({ params }: Props) { const { lang, slug } = await params; const dict = await getDictionary(lang); let post: PBPost; try { post = await pb .collection(`posts_${lang}`) .getFirstListItem(`slug = "${slug}" && published = true`, { cache: "no-store", }); } catch (error) { notFound(); } return (
root@netrunner:~# {dict.blog.backBtn}
{post.image && (
{/* eslint-disable-next-line @next/next/no-img-element */} {post.title}
)}
{new Date(post.created).toLocaleDateString( lang === "ru" ? "ru-RU" : "en-US", )} {dict.blog.readTime} {dict.blog.verified}

{post.title}

{dict.blog.endTransmission}
); }