import { useState } from 'react' import { MessageSquare, Send } from 'lucide-react' export default function CommentSection({ data, onUpdate }) { const [comments, setComments] = useState(data?.comments || []) const [newComment, setNewComment] = useState('') const handleSubmit = (e) => { e.preventDefault() if (newComment.trim()) { const comment = { id: Date.now(), text: newComment, author: 'You', timestamp: new Date().toLocaleTimeString() } setComments(prev => [...prev, comment]) setNewComment('') } } return (
{comment.text}
No comments yet. Be the first to share your thoughts!
)}