.
All checks were successful
Deploy blog-frontend / build-and-deploy (push) Successful in 2m30s

This commit is contained in:
wypark
2026-05-28 21:45:30 +09:00
parent 58a012621a
commit 0273cae6e4
37 changed files with 2625 additions and 1319 deletions

View File

@@ -5,6 +5,7 @@ import { getComments } from '@/api/comments';
import CommentForm from './CommentForm';
import CommentItem from './CommentItem';
import { Loader2, MessageCircle } from 'lucide-react';
import { Comment } from '@/types';
interface CommentListProps {
postSlug: string;
@@ -18,7 +19,7 @@ export default function CommentList({ postSlug }: CommentListProps) {
});
// 총 댓글 수 계산 (재귀)
const countComments = (list: any[]): number => {
const countComments = (list: Comment[]): number => {
if (!list) return 0;
return list.reduce((acc, curr) => acc + 1 + countComments(curr.children), 0);
};
@@ -61,4 +62,4 @@ export default function CommentList({ postSlug }: CommentListProps) {
</div>
</div>
);
}
}