1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 12:26:40 +07:00
vault-frontend/src/hooks/navigation/useImageModal.ts
2025-01-24 17:51:59 +07:00

16 lines
405 B
TypeScript

import { useCallback } from 'react';
import { Dialog } from '~/constants/modal';
import { useShowModal } from '~/hooks/modal/useShowModal';
import { IFile } from '~/types';
export const useImageModal = () => {
const showModal = useShowModal(Dialog.Photoswipe);
return useCallback(
(images: IFile[], index: number) => {
showModal({ items: images, index });
},
[showModal],
);
};