diff --git a/frontend/src/features/hero/components/FocusDialog.tsx b/frontend/src/features/hero/components/FocusDialog.tsx
index 37a0ed8..61ac2d6 100644
--- a/frontend/src/features/hero/components/FocusDialog.tsx
+++ b/frontend/src/features/hero/components/FocusDialog.tsx
@@ -18,11 +18,13 @@ interface FocusDialogProps {
/** Keeps the change locally: it is sent and made live when the hero is saved, and dropped when the page is left. */
onApply: (imageId: string, request: HeroFocusRequest) => void;
onClose: () => void;
- /** The slide has a crop of its own: offers "use the crop of the photo again". */
+ /** "Use the crop of the photo again": applied at once, the dialog stays open. The button is always shown. */
onReset?: () => void;
+ /** The slide has a crop of its own; without one there is nothing to reset and the button is disabled. */
+ canReset?: boolean;
}
-export function FocusDialog({ image, onApply, onClose, onReset }: FocusDialogProps) {
+export function FocusDialog({ image, onApply, onClose, onReset, canReset = false }: FocusDialogProps) {
const { t } = useTranslation();
return (
);
@@ -39,7 +42,7 @@ export function FocusDialog({ image, onApply, onClose, onReset }: FocusDialogPro
const percent = (fraction: number) => Math.round(fraction * 1000) / 10;
-function FocusEditor({ image, onApply, onClose, onReset }: { image: HeroImageDto; onApply: (imageId: string, request: HeroFocusRequest) => void; onClose: () => void; onReset?: () => void }) {
+function FocusEditor({ image, onApply, onClose, onReset, canReset }: { image: HeroImageDto; onApply: (imageId: string, request: HeroFocusRequest) => void; onClose: () => void; onReset?: () => void; canReset: boolean }) {
const { t } = useTranslation();
const area = useRef(null);
// The whole picture: image.src is already a crop of the wide shape and would be shown stretched and out of place.
@@ -238,16 +241,7 @@ function FocusEditor({ image, onApply, onClose, onReset }: { image: HeroImageDto