diff --git a/src/photo/PhotoHeader.tsx b/src/photo/PhotoHeader.tsx index 5e5b16d2..88bdb5d0 100644 --- a/src/photo/PhotoHeader.tsx +++ b/src/photo/PhotoHeader.tsx @@ -23,7 +23,7 @@ export default function PhotoHeader({ photos, selectedPhoto, entity, - entityVerb, + entityVerb = 'PHOTO', entityDescription, sharePath, indexNumber, @@ -50,6 +50,8 @@ export default function PhotoHeader({ (indexNumber || (selectedPhotoIndex ?? 0 + 1)) + ' of ' + (count ?? photos.length); + const isPhotoSet = selectedPhotoIndex === undefined; + const renderPrevNext = () => - {entity ?? (selectedPhoto - ? {selectedPhoto.title || formatDate(selectedPhoto.takenAt, 'tiny')} - - : undefined)} + )} {entity && <> - {selectedPhotoIndex !== undefined - ? - {entityVerb || 'PHOTO'} {paginationLabel} - - : entityDescription} - {selectedPhotoIndex === undefined && sharePath && - } + {isPhotoSet + ? <> + {entityDescription} + {sharePath && + } + + : + {entityVerb} {paginationLabel} + } }