Vercel/src/photo/PhotosLargeInfinite.tsx
Sam Becker d7fbc8bd68
Configurable photo sort order (#277)
* Introduce configurable photo sort order

* Fix recents image pre-rendering

* Refine sort order config

* Store sort order in client state

* Add core views to support sort

* Separate sort and priority preferences

* Consolidate imports, add lint rule

* Refine photo sorting documentation

* Update README sort text

* Finalize sort config
2025-06-29 21:05:13 -05:00

35 lines
845 B
TypeScript

'use client';
import { PATH_FEED_INFERRED } from '@/app/paths';
import InfinitePhotoScroll from './InfinitePhotoScroll';
import PhotosLarge from './PhotosLarge';
import { SortBy } from './db/sort';
export default function PhotosLargeInfinite({
initialOffset,
itemsPerPage,
sortBy,
}: {
initialOffset: number
itemsPerPage: number
sortBy: SortBy
sortWithPriority: boolean
}) {
return (
<InfinitePhotoScroll
cacheKey={`page-${PATH_FEED_INFERRED}`}
initialOffset={initialOffset}
itemsPerPage={itemsPerPage}
sortBy={sortBy}
wrapMoreButtonInGrid
>
{({ photos, onLastPhotoVisible, revalidatePhoto }) =>
<PhotosLarge
photos={photos}
onLastPhotoVisible={onLastPhotoVisible}
revalidatePhoto={revalidatePhoto}
/>}
</InfinitePhotoScroll>
);
}