diff --git a/src/admin/AdminPhotosTable.tsx b/src/admin/AdminPhotosTable.tsx
index 15d6c6fc..a8db1804 100644
--- a/src/admin/AdminPhotosTable.tsx
+++ b/src/admin/AdminPhotosTable.tsx
@@ -11,8 +11,6 @@ import { AiOutlineEyeInvisible } from 'react-icons/ai';
import PhotoDate from '@/photo/PhotoDate';
import FormWithConfirm from '@/components/FormWithConfirm';
import EditButton from './EditButton';
-import SubmitButtonWithStatus from '@/components/SubmitButtonWithStatus';
-import IconGrSync from '@/site/IconGrSync';
import DeleteButton from './DeleteButton';
import {
deletePhotoFormAction,
@@ -20,6 +18,7 @@ import {
} from '@/photo/actions';
import { useAppState } from '@/state/AppState';
import { RevalidatePhoto } from '@/photo/InfinitePhotoScroll';
+import PhotoSyncButton from './PhotoSyncButton';
export default function AdminPhotosTable({
photos,
@@ -82,25 +81,15 @@ export default function AdminPhotosTable({
'gap-2 sm:gap-3 items-center',
)}>
-
-
- }
- onFormSubmitToastMessage={`
- "${titleForPhoto(photo)}" EXIF data synced
- `}
- onFormSubmit={invalidateSwr}
- />
-
+ photoTitle={titleForPhoto(photo)}
+ formData={{ photoId: photo.id }}
+ onFormSubmit={invalidateSwr}
+ includeLabel={false}
+ shouldConfirm
+ shouldToast
+ />
void
+ includeLabel?: boolean
+ formData?: {
+ photoId?: string
+ photoUrl?: string
+ }
+ photoTitle?: string
+ shouldConfirm?: boolean
+ shouldToast?: boolean
+} & ComponentProps) {
+ const confirmText =
+ 'Are you sure you want to overwrite EXIF data ' + (photoTitle
+ ? `for "${photoTitle}" from source file? `
+ : 'from source file? '
+ ) + 'This action cannot be undone.';
+ return (
+
+ {photoId &&
+ }
+ {photoUrl &&
+ }
+ }
+ onFormSubmitToastMessage={shouldToast
+ ? photoTitle
+ ? `"${photoTitle}" EXIF data synced`
+ : 'EXIF data synced'
+ : undefined}
+ onFormSubmit={onFormSubmit}
+ >
+ {includeLabel ? 'EXIF' : null}
+
+
+ );
+}
diff --git a/src/components/FormWithConfirm.tsx b/src/components/FormWithConfirm.tsx
index 07450dcc..d0d68a17 100644
--- a/src/components/FormWithConfirm.tsx
+++ b/src/components/FormWithConfirm.tsx
@@ -8,8 +8,8 @@ export default function FormWithConfirm({
onSubmit,
children,
}: {
- action: (data: FormData) => Promise
- confirmText: string
+ action: (formData: FormData) => void
+ confirmText?: string
onSubmit?: () => void
children: ReactNode
}) {
@@ -17,11 +17,11 @@ export default function FormWithConfirm({