feat(comments): migrate to backend API

This commit is contained in:
zetaloop
2026-03-01 22:40:29 +08:00
parent 505d9c0168
commit 236c1a24da
4 changed files with 169 additions and 69 deletions
+2 -7
View File
@@ -1,17 +1,12 @@
"use client"
import { useCommentStore } from "@/store/comments"
import { MessageCircle } from "lucide-react"
interface PostCommentCountProps {
postId: string
count: number
}
export function PostCommentCount({ postId }: PostCommentCountProps) {
const count = useCommentStore(
(state) => state.comments.filter((comment) => comment.postId === postId).length,
)
export function PostCommentCount({ count }: PostCommentCountProps) {
return (
<span className="flex items-center gap-1">
<MessageCircle className="h-4 w-4" />