Vercel/src/photo/PhotosLarge.tsx
Sam Becker a63f2c3fe3
Select All Photos (1 of 2) (#372)
* Add 'select all photos' to app state

* Create general purpose bulk photo action

* Fix infinite scroll pagination, temporarily hide "select all"

* Refine batch edit behavior

* Add admin endpoints to check storage

* Add missing storage count

* Refine missing file presentation

* Finalize storage status page

* Store image-dependent photo fields when reuploading

* Move storage checks behind flag
2026-02-12 22:28:37 -06:00

46 lines
1.2 KiB
TypeScript

import AnimateItems from '@/components/AnimateItems';
import { Photo } from '.';
import PhotoLarge from './PhotoLarge';
import { RevalidatePhoto } from './InfinitePhotoScroll';
export default function PhotosLarge({
photos,
animate = true,
prefetchFirstPhotoLinks,
onLastPhotoVisible,
revalidatePhoto,
showStorageCheck,
}: {
photos: Photo[]
animate?: boolean
prefetchFirstPhotoLinks?: boolean
onLastPhotoVisible?: () => void
revalidatePhoto?: RevalidatePhoto
showStorageCheck?: boolean
}) {
return (
<AnimateItems
className="space-y-1"
type={animate ? 'scale' : 'none'}
duration={0.7}
staggerDelay={0.15}
distanceOffset={0}
staggerOnFirstLoadOnly
items={photos.map((photo, index) =>
<PhotoLarge
key={photo.id}
photo={photo}
priority={index <= 1}
prefetchRelatedLinks={prefetchFirstPhotoLinks && index === 0}
revalidatePhoto={revalidatePhoto}
shouldZoomOnFKeydown={false}
onVisible={index === photos.length - 1
? onLastPhotoVisible
: undefined}
showStorageCheck={showStorageCheck}
/>)}
itemKeys={photos.map(photo => photo.id)}
/>
);
}