From 7809f2115171c9fe36a691683123f994488ecc2a Mon Sep 17 00:00:00 2001 From: Danijel Martinek Date: Tue, 5 May 2026 08:55:41 +0200 Subject: [PATCH] feat(web-next): render /blog/[slug] article detail via blog.articleBySlug --- apps/web-next/src/app/blog/[slug]/page.tsx | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 apps/web-next/src/app/blog/[slug]/page.tsx diff --git a/apps/web-next/src/app/blog/[slug]/page.tsx b/apps/web-next/src/app/blog/[slug]/page.tsx new file mode 100644 index 0000000..9705f2e --- /dev/null +++ b/apps/web-next/src/app/blog/[slug]/page.tsx @@ -0,0 +1,34 @@ +import { notFound } from "next/navigation"; +import { appRouter } from "@repo/core-api"; +import { bindAllProduction } from "../../../server/bind-production"; + +type PageProps = { + params: Promise<{ slug: string }>; +}; + +export default async function BlogPostPage({ params }: PageProps) { + await bindAllProduction(); + const { slug } = await params; + const caller = appRouter.createCaller({}); + const article = await caller.blog.articleBySlug({ slug }); + + if (!article) notFound(); + + return ( +
+
+
+

{article.title}

+ {article.createdAt ? ( + + ) : null} +
+
+          {JSON.stringify(article.content, null, 2)}
+        
+
+
+ ); +}