- {/* Image Gallery - Combines owner photos + community photos */}
- {(() => {
- const allImages = [
- ...spot.images.map(url => ({ url, isOwner: true })),
- ...(communityPhotos || []).map(p => ({ url: p.url, isOwner: false, caption: p.caption })),
- ];
-
- return allImages.length > 0 ? (
- <>
-
-
- {!allImages[0].isOwner && (
-
-
- Community
-
- )}
-
-
- {/* Additional images */}
- {allImages.length > 1 && (
-
- {allImages.slice(1, 5).map((img, idx) => (
-
-
- {!img.isOwner && (
-
+ {/* Image Gallery - owner photos + community photos; click to view full size */}
+ {galleryImages.length > 0 ? (
+ <>
+
+
+ {/* Additional images */}
+ {galleryImages.length > 1 && (
+
+ {galleryImages.slice(1, 5).map((img, idx) => {
+ const realIndex = idx + 1;
+ const remaining = galleryImages.length - 5;
+ return (
+
- ))}
-
- )}
- >
- ) : (
-
-
-
- );
- })()}
+ {idx === 3 && remaining > 0 && (
+
+ +{remaining}
+
+ )}
+
+ );
+ })}
+
+ )}
+ >
+ ) : (
+
+
+
+ )}
{/* Spot Info */}
@@ -1043,6 +1068,14 @@ export default function SpotDetailPage() {
destination={coordinates}
destinationLabel={spot?.title ?? 'Spot'}
/>
+
+ {/* Full-screen photo viewer */}
+ setLightboxIndex(null)}
+ />
);
}