1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00
vault-frontend/src/utils/hooks/useImageModal.ts
2021-11-06 21:14:50 +07:00

13 lines
384 B
TypeScript

import { useCallback } from 'react';
import { IFile } from '~/redux/types';
import { modalShowPhotoswipe } from '~/redux/modal/actions';
import { useDispatch } from 'react-redux';
export const useImageModal = () => {
const dispatch = useDispatch();
return useCallback(
(images: IFile[], index: number) => dispatch(modalShowPhotoswipe(images, index)),
[dispatch]
);
};