@props([ 'images' => collect(), 'focusedImageId' => null, ]) @php // Images are already pre-structured from getGroupedVisibleImages() // with thumb, medium, and large paths mapped to appropriate sizes $mappedImages = $images->toArray(); $componentId = 'gallery-' . uniqid(); // Find the index of the focused image if provided $initialIndex = 0; if ($focusedImageId) { foreach ($mappedImages as $index => $img) { if (isset($img['id']) && $img['id'] == $focusedImageId) { $initialIndex = $index; break; } } } @endphp
Click to zoom