import React from 'react' // ── Pagination ──────────────────────────────────────────────────────────────── function Pagination({ meta, onPageChange }) { if (!meta || meta.last_page <= 1) return null const { current_page, last_page } = meta const pages = [] if (last_page <= 7) { for (let i = 1; i <= last_page; i++) pages.push(i) } else { const around = new Set( [1, last_page, current_page, current_page - 1, current_page + 1].filter( (p) => p >= 1 && p <= last_page ) ) const sorted = [...around].sort((a, b) => a - b) for (let i = 0; i < sorted.length; i++) { if (i > 0 && sorted[i] - sorted[i - 1] > 1) pages.push('…') pages.push(sorted[i]) } } return ( ) } // ── Pin icon (for artwork reference) ───────────────────────────────────────── function PinIcon() { return ( ) } // ── Artwork image icon (for right panel label) ──────────────────────────────── function ImageIcon() { return ( ) } // ── Single comment row ──────────────────────────────────────────────────────── function CommentItem({ comment }) { const { commenter, artwork, comment_text, time_ago, created_at } = comment return (
{/* ── Avatar ── */} {commenter.display} { e.currentTarget.onerror = null e.currentTarget.src = commenter.avatar_fallback || 'https://files.skinbase.org/default/avatar_default.webp' }} /> {/* ── Main content ── */}
{/* Author + time */}
{commenter.display}
{/* Comment text — primary visual element */}

{comment_text}

{/* Artwork reference link */} {artwork && ( {artwork.title} )}
{/* ── Right: artwork thumbnail ── */} {artwork?.thumb && ( )}
) } // ── Loading skeleton ────────────────────────────────────────────────────────── function FeedSkeleton() { return (
{Array.from({ length: 6 }).map((_, i) => (
{/* avatar */}
{/* content */}
{/* thumbnail */}
))}
) } // ── Empty state ─────────────────────────────────────────────────────────────── function EmptyState() { return (

No comments found.

) } // ── Main export ─────────────────────────────────────────────────────────────── export default function CommentsFeed({ comments = [], meta = {}, loading = false, error = null, onPageChange, }) { if (loading) return if (error) { return (
{error}
) } if (!comments || comments.length === 0) return return (
{comments.map((comment) => ( ))}
) }