Extracted the grid mapping logic out of the return block into a `useMemo` hook depending on `[assets, layout, openLightbox]`. This prevents the entire photo grid—including complex Next.js `<Image>` and `<FadeIn>` components—from needlessly re-rendering every time the user navigates via the lightbox arrows or presses next/prev buttons, which previously caused `lightboxIndex` to update and trigger a re-render of the entire grid. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
6.5 KiB
6.5 KiB