+
+ {
+ setUploadState?.({
+ isUploading: true,
+ uploadError: '',
+ });
+ }}
+ onBlobReady={async ({
+ blob,
+ extension,
+ hasMultipleUploads,
+ isLastBlob,
+ }) => {
+ if (debug) {
+ setUploadState?.({
+ isUploading: false,
+ uploadError: '',
+ debugDownload: {
+ href: URL.createObjectURL(blob),
+ fileName: `debug.${extension}`,
+ },
+ });
+ } else {
+ return uploadPhotoFromClient(
+ blob,
+ extension,
+ )
+ .then(async url => {
+ if (isLastBlob) {
+ await onLastUpload?.();
+ shouldResetUploadStateAfterPending.current = true;
+ startTransition(() => hasMultipleUploads
+ ? router.push(PATH_ADMIN_UPLOADS)
+ : router.push(pathForAdminUploadUrl(url)));
+ }
+ })
+ .catch(error => {
+ setUploadState?.({
+ isUploading: false,
+ uploadError: `Upload Error: ${error.message}`,
+ });
+ });
+ }
+ }}
+ showButton={showButton}
+ debug={debug}
+ />
+
+ {showStatusText &&
+ {isUploading && !showButton &&
+ }
+
+ {isUploading
+ ? isFinishing
+ ? <>
+ Finishing
+ >
+ : <>
+ {!showButton &&
+ `Uploading ${fileUploadIndex + 1} of ${filesLength}: `}
+ {fileUploadName}
+ >
+ : !showButton && <>Initializing>}
+
+
}
+ {debug && debugDownload &&
+
+ Download
+ }
+ {uploadError &&
+
+ {uploadError}
+
}
+
+ );
+};
diff --git a/src/photo/PhotosEmptyState.tsx b/src/photo/PhotosEmptyState.tsx
index ea7cfa78..c8377e23 100644
--- a/src/photo/PhotosEmptyState.tsx
+++ b/src/photo/PhotosEmptyState.tsx
@@ -1,12 +1,13 @@
import AdminCTA from '@/admin/AdminCTA';
import Container from '@/components/Container';
import SiteGrid from '@/components/SiteGrid';
-import { IS_SITE_READY } from '@/app/config';
+import { IS_SITE_READY, PRESERVE_ORIGINAL_UPLOADS } from '@/app/config';
import { PATH_ADMIN_CONFIGURATION } from '@/app/paths';
import AdminAppConfiguration from '@/admin/AdminAppConfiguration';
import { clsx } from 'clsx/lite';
import Link from 'next/link';
import { HiOutlinePhotograph } from 'react-icons/hi';
+import { revalidatePath } from 'next/cache';
export default function PhotosEmptyState() {
return (
@@ -33,7 +34,14 @@ export default function PhotosEmptyState() {