'use client' import { useEffect, useRef, useCallback } from 'react' export interface GridPost { id: string content: string author: { username: string avatarUrl?: string } likes: number comments: number createdAt: string thumbnailUrl?: string /** Author-supplied alt text for the thumbnail (accessibility). */ thumbnailAlt?: string } export interface PostGridProps { posts: GridPost[] onLoadMore: () => void hasMore: boolean isLoading: boolean } const CONTENT_PREVIEW_MAX = 80 function truncate(text: string, max: number): string { if (text.length <= max) return text return text.slice(0, max).trimEnd() + '…' } function HeartIcon() { return ( ) } function CommentIcon() { return ( ) } function SkeletonCell() { return (