import { useComments } from '@/hooks/useComments'; import { Skeleton } from '@/components/ui/skeleton'; import { MessageSquare } from 'lucide-react'; import { cn } from '@/lib/utils'; import type { NostrEvent } from '@nostrify/nostrify'; import { CommentForm } from './CommentForm'; import { Comment } from './Comment'; interface CommentsSectionProps { root: NostrEvent | URL | `#${string}`; emptyStateMessage?: string; emptyStateSubtitle?: string; className?: string; limit?: number; } export function CommentsSection({ root, emptyStateMessage = "No comments yet", emptyStateSubtitle = "Be the first to share your thoughts!", className, limit = 500, }: CommentsSectionProps) { const { data: commentsData, isLoading, error } = useComments(root, limit); const comments = commentsData?.topLevelComments || []; if (error) { return (
Failed to load comments
{emptyStateMessage}
{emptyStateSubtitle}