diff --git a/next.config.ts b/next.config.ts
index 98dec97..a8262f8 100644
--- a/next.config.ts
+++ b/next.config.ts
@@ -10,6 +10,7 @@ const nextConfig: NextConfig = {
},
];
},
+ cacheComponents: true,
};
export default nextConfig;
diff --git a/src/app/(pages)/article/[slug]/page.tsx b/src/app/(pages)/article/[slug]/page.tsx
index c5947ea..e0735e4 100644
--- a/src/app/(pages)/article/[slug]/page.tsx
+++ b/src/app/(pages)/article/[slug]/page.tsx
@@ -10,6 +10,10 @@ interface ArticlePageProps {
params: Promise<{ slug: string }>;
}
+interface ArticleContentProps {
+ params: Promise<{ slug: string }>;
+}
+
function readingTime(text: string): number {
const words = text.trim().split(/\s+/).length;
return Math.max(1, Math.ceil(words / 200));
@@ -64,7 +68,8 @@ const ArticleContentSkeleton = () => (
);
-const ArticleContent = async ({ slug }: { slug: string }) => {
+const ArticleContent = async ({ params }: ArticleContentProps) => {
+ const { slug } = await params;
const article = await getArticleBySlug(slug);
if (!article) notFound();
@@ -137,12 +142,10 @@ const ArticleContent = async ({ slug }: { slug: string }) => {
);
};
-const ArticlePage = async ({ params }: ArticlePageProps) => {
- const { slug } = await params;
-
+const ArticlePage = ({ params }: ArticlePageProps) => {
return (