feat(posts): wire community pages to backend posts API

This commit is contained in:
zetaloop
2026-02-28 17:25:57 +08:00
parent bffd8b4968
commit e94a7e68ff
5 changed files with 204 additions and 127 deletions
+6 -2
View File
@@ -14,7 +14,7 @@ import { notFound } from "next/navigation"
export default async function PostDetailPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params
const post = getPostById(id)
const post = await getPostById(id)
if (!post) notFound()
const linkedOrder = post.linkedOrderId ? getOrderById(post.linkedOrderId) : null
@@ -91,7 +91,11 @@ export default async function PostDetailPage({ params }: { params: Promise<{ id:
)}
<div className="flex items-center gap-4 text-sm text-muted-foreground pt-2">
<PostLikeButton postId={post.id} />
<PostLikeButton
postId={post.id}
initialLiked={post.liked}
initialLikeCount={post.likeCount}
/>
<PostCommentCount postId={post.id} />
</div>
</CardContent>