Initial Comments - Copy this React, Tailwind Component to your project
Please fix the "Reply to comment" functionality in the Reddit-style comment section. ✅ What’s working: The reply button is visible and opens a reply input Comments and static replies are rendering correctly ❌ What’s broken: When I type a reply and submit it, the reply is not appended to the comment thread 🔧 What to do: Implement the logic to dynamically insert the new reply under the correct parent comment Use a recursive function to traverse the comment tree and insert the reply into the correct replies array based on parentId After inserting, update the state so the UI re-renders 🧠 Requirements: Comments are stored in nested format (each comment has a replies array) Use useState or useReducer for comment state The reply should: Appear nested under the comment it was posted to Be visually indented Auto-clear the input box Not affect top-level comment order 🎯 Keep everything else exactly as it is (UI, styling, structure). Only implement proper dynamic reply posting logic.
