diff --git a/src/app/(main)/blog/[slug]/loading.tsx b/src/app/(main)/blog/[slug]/loading.tsx
new file mode 100644
index 0000000..779bae8
--- /dev/null
+++ b/src/app/(main)/blog/[slug]/loading.tsx
@@ -0,0 +1,5 @@
+import LoaderFixed from "@/components/loaders/LoaderFixed";
+
+export default function Loading() {
+ return ;
+}
diff --git a/src/app/(main)/blog/[slug]/page.tsx b/src/app/(main)/blog/[slug]/page.tsx
index d4f4ad6..e81e588 100644
--- a/src/app/(main)/blog/[slug]/page.tsx
+++ b/src/app/(main)/blog/[slug]/page.tsx
@@ -1,7 +1,10 @@
import HeroImage from "@/components/HeroImage";
+import { fetchBlogDetail } from "@/services/payload/blog";
import { getDefaultMetadata } from "@/utils/metadata";
+import { RichText } from "@payloadcms/richtext-lexical/react";
import { Metadata } from "next";
import Image from "next/image";
+import { notFound } from "next/navigation";
const metaDesc =
"Explore the latest insights, news, and resources on the Dynamic Realty blog. Read our articles today.";
@@ -14,7 +17,12 @@ export async function generateMetadata(): Promise {
return metadata;
}
-export default function BlogDetail() {
+export default async function BlogDetail(props: { params: Promise<{ slug: string }> }) {
+ const params = await props.params;
+ const blog = await fetchBlogDetail(params.slug);
+
+ if (!blog) return notFound();
+
return (
<>
@@ -25,10 +33,7 @@ export default function BlogDetail() {
-
- Showcasing a warm, traditional-style exterior and the highest caliber of contemporary European
- finishes throughout, towering glass doors open to grand-scale living spaces.
-
+
@@ -36,7 +41,7 @@ export default function BlogDetail() {