A React hook that provides state management for a dynamically loaded lightbox component using yet-another-react-lightbox.
import useLightbox from '@/hooks/use-lightbox'export default function Gallery() {const { openLightbox, renderLightbox } = useLightbox()return (<><button onClick={openLightbox}>Open Lightbox</button>{renderLightbox({slides: [{ src: '/images/photo1.jpg' },{ src: '/images/photo2.jpg' },{ src: '/images/photo3.jpg' },],})}</>)}
openLightbox: Function to open the lightboxrenderLightbox: Function that renders the lightbox component with provided propsAccepts all props from yet-another-react-lightbox except open and close, including:
slides: Array of slide objects with image sourcesindex: Starting slide indexplugins: Array of lightbox pluginsyet-another-react-lightbox for full-featured image galleriesThis hook is currently not used in the codebase but is available for implementing image lightbox functionality.