Skip to content

Commit 4fb6915

Browse files
committed
feat: update CommentSection to render comments from query data and enhance CommentItem display
1 parent 496c6b5 commit 4fb6915

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/components/comment-section.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ export const CommentSection = (props: {
9696
/>
9797
</div>
9898

99-
<pre>{JSON.stringify(query.data, null, 2)}</pre>
99+
{/* <pre>{JSON.stringify(query.data, null, 2)}</pre> */}
100100

101101
{/* Comments List */}
102-
{/* <div className="space-y-4">
103-
{sampleComments.map((comment) => (
104-
<CommentItem key={comment.id} comment={comment} onReply={addReply} />
102+
<div className="space-y-4">
103+
{query?.data?.map((comment) => (
104+
<CommentItem key={comment.id} comment={comment} />
105105
))}
106-
</div> */}
106+
</div>
107107
</div>
108108
);
109109
};
@@ -161,3 +161,11 @@ const CommentEditor = (props: {
161161
</form>
162162
);
163163
};
164+
165+
const CommentItem = (props: { comment: CommentPresentation }) => {
166+
return (
167+
<div>
168+
<pre className=" font-normal">{props.comment.body}</pre>
169+
</div>
170+
);
171+
};

0 commit comments

Comments
 (0)