From 98abcc023b99898f3a7e182e2330ea809a4c99e2 Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Sun, 12 Jan 2025 19:43:59 +0900
Subject: refactor(blog/nuldoc): convert components/*.ts to TSX

---
 .../blog/nuldoc-src/components/PostPageEntry.tsx   | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 vhosts/blog/nuldoc-src/components/PostPageEntry.tsx

(limited to 'vhosts/blog/nuldoc-src/components/PostPageEntry.tsx')

diff --git a/vhosts/blog/nuldoc-src/components/PostPageEntry.tsx b/vhosts/blog/nuldoc-src/components/PostPageEntry.tsx
new file mode 100644
index 00000000..52e2b5d4
--- /dev/null
+++ b/vhosts/blog/nuldoc-src/components/PostPageEntry.tsx
@@ -0,0 +1,39 @@
+import {
+  getPostPublishedDate,
+  getPostUpdatedDate,
+  postHasAnyUpdates,
+  PostPage,
+} from "../pages/post.tsx";
+import { dateToString } from "../revision.ts";
+
+export default function PostPageEntry({ post }: { post: PostPage }) {
+  return (
+    <article className="post-entry">
+      <a href={post.href}>
+        <header className="entry-header">
+          <h2>{post.title}</h2>
+        </header>
+        <section className="entry-content">
+          <p>{post.description}</p>
+        </section>
+        <footer className="entry-footer">
+          <time datetime={dateToString(getPostPublishedDate(post))}>
+            {dateToString(getPostPublishedDate(post))}
+          </time>
+          {" 投稿"}
+          {
+            // TODO(jsx): support Fragment and merge them.
+            postHasAnyUpdates(post) && "、"
+          }
+          {postHasAnyUpdates(post) &&
+            (
+              <time datetime={dateToString(getPostUpdatedDate(post))}>
+                {dateToString(getPostUpdatedDate(post))}
+              </time>
+            )}
+          {postHasAnyUpdates(post) && " 更新"}
+        </footer>
+      </a>
+    </article>
+  );
+}
-- 
cgit v1.2.3-70-g09d2

