Moved later/gitgram-ai/gitgram/ to apps/ritgram/ (fresh history; full history stays in caelum0x/gitgram). AITimeMachine stays separate in later/gitgram-ai per the Rithub master plan. Logs, pid files and env files are ignored; GPL-3.0 mobile/proximity noted in THIRD_PARTY_NOTICES. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
25 lines
563 B
TypeScript
25 lines
563 B
TypeScript
import { useCallback } from 'react';
|
|
|
|
import { useLightboxStore, LightboxImage } from './lightboxStore';
|
|
|
|
/**
|
|
* Convenience hook to open the global lightbox from any component.
|
|
*
|
|
* Usage:
|
|
* const openLightbox = useLightbox();
|
|
* openLightbox([{ uri, alt }], 0);
|
|
*/
|
|
export function useLightbox(): (
|
|
images: LightboxImage[],
|
|
initialIndex?: number,
|
|
) => void {
|
|
const open = useLightboxStore((state) => state.open);
|
|
|
|
return useCallback(
|
|
(images: LightboxImage[], initialIndex = 0) => {
|
|
open(images, initialIndex);
|
|
},
|
|
[open],
|
|
);
|
|
}
|