-
- {components.slice(0, (indexInView ?? 0) + 1)}
-
- {showMoreButton && (
- wrapMoreButtonInSiteGrid
- ?
- : renderMoreButton()
- )}
-
- >;
-}
diff --git a/src/photo/MorePhotosGrid.tsx b/src/photo/MorePhotosGrid.tsx
deleted file mode 100644
index ec39f293..00000000
--- a/src/photo/MorePhotosGrid.tsx
+++ /dev/null
@@ -1,53 +0,0 @@
-import MoreComponents from '@/components/MoreComponents';
-import { getPhotosCached } from '@/photo/cache';
-import PhotoGrid from './PhotoGrid';
-import { useCallback } from 'react';
-
-export function MorePhotosGrid({
- initialOffset,
- itemsPerRequest,
- totalPhotosCount,
-}: {
- initialOffset: number
- itemsPerRequest: number
- totalPhotosCount: number
-}) {
- const getNextComponent = useCallback(async (
- offset: number,
- limit: number,
- ) => {
- 'use server';
- if (
- process.env.NODE_ENV === 'development' &&
- Math.random() < 0.5
- ) {
- return { didFail: true };
- }
- const photos = await getPhotosCached({ limit: offset + limit })
- .catch(() => undefined);
- if (!photos) {
- return { didFail: true };
- } else {
- const nextPhotos = photos.slice(offset);
- return {
- ...nextPhotos.length > 0 && {
- nextComponent: