aboutsummaryrefslogtreecommitdiff
path: root/components/post-card.tsx
diff options
context:
space:
mode:
authorschererleander <leander@schererleander.de>2025-12-25 23:33:25 +0000
committerschererleander <leander@schererleander.de>2025-12-25 23:33:25 +0000
commitd82fb3b552d20a279efdd9408042183cfa02fb48 (patch)
tree4ffe818e591e54da71f7592506c873abf0d9d481 /components/post-card.tsx
parentd7edbf05ab0e90eedcb99e4462e3a61793b2eff9 (diff)
initial commit
Diffstat (limited to 'components/post-card.tsx')
-rw-r--r--components/post-card.tsx20
1 files changed, 20 insertions, 0 deletions
diff --git a/components/post-card.tsx b/components/post-card.tsx
new file mode 100644
index 0000000..4990188
--- /dev/null
+++ b/components/post-card.tsx
@@ -0,0 +1,20 @@
+import { type Post } from "contentlayer/generated"
+import { format, parseISO } from "date-fns"
+import Link from "next/link"
+
+export function PostCard(post: Post) {
+ return (
+ <div className="mb-8">
+ <Link href={post.url} className="no-underline">
+ <h2 className="mb-1.5 mt-3 text-xl font-bold text-foreground">
+ {post.title}
+ </h2>
+ </Link>
+ <div className="flex gap-1.5 font-medium text-muted-foreground/60">
+ <time dateTime={post.date} title={format(parseISO(post.date), 'yyyy/MM/dd')}>
+ {format(parseISO(post.date), 'do MMM yyyy')}
+ </time>
+ </div>
+ </div>
+ )
+}