import { pb, getPbImage } from "@/lib/pb"; import { notFound } from "next/navigation"; import Link from "next/link"; import { ArrowLeft, Calendar, Clock, ShieldCheck } from "lucide-react"; 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 isRu = lang === "ru"; let post: PBPost; try { post = await pb .collection("posts") .getFirstListItem( `slug = "${slug}" && lang = "${lang}" && published = true`, { cache: "no-store" }, ); } catch (error) { // В продакшене лучше не логировать каждый 404, чтобы не забивать консоль notFound(); } return (
{/* Хлебные крошки / Назад */} root@netrunner:~# cd ../logs
{/* Обложка с неоновым свечением */} {post.image && (
{/* eslint-disable-next-line @next/next/no-img-element */} {post.title}
)} {/* Шапка статьи */}
{new Date(post.created).toLocaleDateString( isRu ? "ru-RU" : "en-US", )} {isRu ? "Чтение: 4 мин" : "Read: 4 min"} {isRu ? "Проверено: Netrunner" : "Verified: Netrunner"}

{post.title}

{/* Тело статьи с Tailwind Typography (prose) */}
{/* Футер статьи */}
End of transmission // node_th_01
); }