mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 12:26:40 +07:00
16 lines
405 B
TypeScript
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],
|
|
);
|
|
};
|