diff --git a/src/app/(site)/news/[...slug]/page.tsx b/src/app/(site)/news/[...slug]/page.tsx index 148f4f4c..9ea18a8a 100644 --- a/src/app/(site)/news/[...slug]/page.tsx +++ b/src/app/(site)/news/[...slug]/page.tsx @@ -1,5 +1,4 @@ -import { connection } from "next/server"; -import { and, asc, desc, eq, inArray } from "drizzle-orm"; +import { and, asc, eq, inArray } from "drizzle-orm"; import type { Metadata } from "next"; import Link from "next/link"; import { notFound } from "next/navigation"; @@ -26,7 +25,6 @@ import { sanitize } from "@/lib/sanitize"; // See: https://nextjs.org/docs/app/guides/migrating-to-cache-components export const instant = false; - type SearchParams = Promise<{ comment?: string; reaction?: string; @@ -64,7 +62,7 @@ export async function generateMetadata({ .from(WebsiteArticles) .where(eq(WebsiteArticles.slug, slug)) .limit(1) - .catch(() => null); + .catch(() => []); if (!article) return { title: "Article" }; return { title: article.title, @@ -116,7 +114,7 @@ export default async function ArticlePage({ .from(WebsiteArticles) .where(eq(WebsiteArticles.slug, slug)) .limit(1) - .catch(() => null); + .catch(() => []); return row ?? null; }, 60, @@ -200,24 +198,24 @@ export default async function ArticlePage({ : null; return ( -
- {comment === "posted" ? ( +
+ {comment === "posted" ? (
{t("success.posted")}
) : null} - {reaction === "1" ? ( + {reaction === "1" ? (
{t("success.reaction")}
) : null} - {errorMessage ? ( + {errorMessage ? (
{errorMessage}
) : null} - {article.image ? ( // eslint-disable-next-line @next/next/no-img-element - () + /> ) : null} {/* Article body is rich HTML (atom uses TinyMCE) — sanitised server-side. */} - {/* ── Reactions ─────────────────────────────────────────── */} - - {/* ── Comments ──────────────────────────────────────────── */} - )} -
- ); +
+ ); }