import { useState } from "react" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { User } from "lucide-react" interface Comment { id: number user_id: number content: string created_at: string } interface CommentSectionProps { comments: Comment[] onAddComment: (content: string) => void } export function CommentSection({ comments, onAddComment }: CommentSectionProps) { const [newComment, setNewComment] = useState("") const handleSubmit = (e: React.FormEvent) => { e.preventDefault() if (!newComment.trim()) return onAddComment(newComment) setNewComment("") } return ( Comments ({comments.length})
setNewComment(e.target.value)} />
{comments.map((comment) => (

User #{comment.user_id}

{comment.content}

{new Date(comment.created_at).toLocaleDateString()}

))}
) }