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 (

Comments & Notes

{comments.map((comment) => (

{comment.text}

{comment.author} {comment.timestamp}
))} {comments.length === 0 && (

No comments yet. Be the first to share your thoughts!

)}
setNewComment(e.target.value)} placeholder="Add a comment or note..." className="flex-1 px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent" />
) }