From da8822ec0e78fb87b2e4b1f56fc239ad93f34791 Mon Sep 17 00:00:00 2001 From: rattatwinko Date: Mon, 16 Jun 2025 17:15:26 +0200 Subject: [PATCH] Enhance post date display with loading state for unpublished posts --- posts/folder/folder2.md | 0 src/app/page.tsx | 12 +++++++++++- src/app/posts/[...slug]/page.tsx | 12 +++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 posts/folder/folder2.md diff --git a/posts/folder/folder2.md b/posts/folder/folder2.md new file mode 100644 index 0000000..e69de29 diff --git a/src/app/page.tsx b/src/app/page.tsx index efeb560..8c19810 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -105,7 +105,17 @@ export default function Home() {

{post.title}

-
Veröffentlicht: {format(new Date(post.date), 'd. MMMM yyyy')}
+ {post.date ? ( +
Veröffentlicht: {format(new Date(post.date), 'd. MMMM yyyy')}
+ ) : ( +
+
+ ⚙️ + ⚙️ +
+
In Bearbeitung
+
+ )}
Erstellt: {format(new Date(post.createdAt), 'd. MMMM yyyy HH:mm')}

{post.summary}

diff --git a/src/app/posts/[...slug]/page.tsx b/src/app/posts/[...slug]/page.tsx index 10d0214..1e1d714 100644 --- a/src/app/posts/[...slug]/page.tsx +++ b/src/app/posts/[...slug]/page.tsx @@ -53,7 +53,17 @@ export default function PostPage({ params }: { params: { slug: string[] } }) {

{post.title}

-
Veröffentlicht: {format(new Date(post.date), 'd. MMMM yyyy')}
+ {post.date ? ( +
Veröffentlicht: {format(new Date(post.date), 'd. MMMM yyyy')}
+ ) : ( +
+
+ ⚙️ + ⚙️ +
+
In Bearbeitung
+
+ )}
Erstellt: {format(new Date(post.createdAt), 'd. MMMM yyyy HH:mm')}