import { useRef } from 'react' import { useIntersectionLoad } from '../../../hooks/useIntersectionLoad.ts' import { Post } from '../posts/posts.ts' import PostItem from './PostItem.tsx' interface FeedViewProps { pages: Post[][] onLoadMore: () => Promise } export default function FeedView({ pages, onLoadMore }: FeedViewProps) { const sentinelRef = useRef(null) const posts = pages.flat() useIntersectionLoad(onLoadMore, sentinelRef) return (
{posts.map((post) => ( ))}
) }